Check wether user can post text on his friend page

This commit is contained in:
Pierre
2017-12-21 18:55:20 +01:00
parent 35d4ab94ac
commit d5eda3c1d4
2 changed files with 35 additions and 1 deletions

View File

@ -103,6 +103,7 @@ class friendsController{
"sent_request" => false,
"received_request" => false,
"following" => false,
"can_post_texts" => false,
);
//Check if the two personns are friend
@ -123,9 +124,14 @@ class friendsController{
else {
//Perform the check specific to the real friend
//Check if the user is following his friend or not
if(CS::get()->components->friends->is_following(userID, $friendID))
$response['following'] = true;
//Check if the user can post text on his friend page
if(CS::get()->components->friends->can_post_text(userID, $friendID))
$response['can_post_texts'] = true;
}
//Return the response