Can push public notifications for group.

This commit is contained in:
Pierre HUBERT
2018-07-20 13:37:59 +02:00
parent d99b4c7f18
commit ed8ee8f04c
2 changed files with 25 additions and 13 deletions

View File

@ -160,8 +160,24 @@ class notificationComponent {
//For the posts on groups
else if($notification->get_from_container_type() == Notification::GROUP_PAGE){
//TODO : implement
return TRUE;
//Get the list of the members of the group that follows it
$list = components()->groups->getListFollowers($notification->get_from_container_id());
//Process the list of followers
$target_users = array();
foreach($list as $userID){
//If the current follower is the user creating the notification
if($userID == $notification->get_from_user_id())
continue;
$target_users[] = $userID;
}
//Push the notification
return $this->push_public($notification, $target_users);
}
//Unimplemented scenario