Can get informations about a specific user

This commit is contained in:
Pierre
2018-03-11 10:57:01 +01:00
parent cd81cfd8ba
commit 6cc90d281f
2 changed files with 35 additions and 2 deletions

View File

@ -79,6 +79,29 @@ class friendsController{
return $IDs;
}
/**
* Get friendship informations about a specific friend
*
* @url POST /friends/get_single_infos
*/
public function get_single_infos(){
user_login_required();
//Get friendID
$friendID = getPostUserID('friendID');
//Get informations about the friendship
$list = components()->friends->getList(userID, $friendID);
//Check if the friend was found or not
if(count($list) == 0)
Rest_fatal_error(404, "Specified friend not found !");
//Return informations about the friend
return $this->parseFriendAPI($list[0], true);
}
/**
* Send a friendship request
*