31 public function send(array $pushList, array $notVisibleGroupsUsers): void
35 || !Loader::includeModule(
'pull')
41 $subscribedUsers = $this->getSubscribedUsers();
43 foreach ($pushList as $push)
46 $groupId = (int)$push[
'GROUP_ID'];
47 $userId = (int)($push[
'USER_ID'] ??
null);
49 if (empty($pushCommand))
55 'module_id' =>
'socialnetwork',
56 'command' => $pushCommand,
57 'params' => [
'GROUP_ID' => $groupId,
'USER_ID' => $userId ],
61 isset($notVisibleGroupsUsers[$groupId])
62 ? array_intersect($subscribedUsers, $notVisibleGroupsUsers[$groupId])
77 'module_id' =>
'socialnetwork',
79 'params' => [
'GROUP_ID' => $groupId,
'USER_ID' => $userId, ],
84 PushService::addEvent([ $eventData[
'USER_ID'] ], $pushParams);
88 $subscribedUsers = $this->getSubscribedUsers();
90 if (!array_key_exists(
'USER_ID', $eventData))
92 $eventData[
'USER_ID'] = [];
95 if (!is_array($eventData[
'USER_ID']))
97 $eventData[
'USER_ID'] = [ $eventData[
'USER_ID'] ];
101 isset($notVisibleGroupsUsers[$groupId])
102 ? array_intersect($subscribedUsers, array_merge($eventData[
'USER_ID'], $notVisibleGroupsUsers[$groupId]))
106 PushService::addEvent($recipients, $pushParams);