Get following status

This commit is contained in:
Pierre
2017-12-21 18:49:50 +01:00
parent 583ef8fc2d
commit 35d4ab94ac
2 changed files with 34 additions and 1 deletions

View File

@ -102,6 +102,7 @@ class friendsController{
"are_friend" => false,
"sent_request" => false,
"received_request" => false,
"following" => false,
);
//Check if the two personns are friend
@ -119,6 +120,13 @@ class friendsController{
if(CS::get()->components->friends->sent_request($friendID, userID))
$response["received_request"] = true;
}
else {
//Perform the check specific to the real friend
if(CS::get()->components->friends->is_following(userID, $friendID))
$response['following'] = true;
}
//Return the response
return $response;