Can get the number of unread conversations of a user

This commit is contained in:
Pierre
2018-02-21 16:13:15 +01:00
parent 3a3c6d9787
commit 2f37d37a54
2 changed files with 34 additions and 0 deletions

View File

@ -386,6 +386,22 @@ class conversationsController{
}
/**
* Get the number of unread conversations of the user
*
* @url POST conversations/get_number_unread
*/
public function get_number_unread(){
user_login_required();
//Get the number of unread conversations of the user
$number_unread_conversations = components()->conversations->number_user_unread(userID);
//Return result
return array("nb_unread" => $number_unread_conversations);
}
/**
* Delete a conversation
*