• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/internals/eventservice/push/workgroupsender.php
  • Класс: BitrixSocialnetworkInternalsEventServicePushWorkgroupSender
  • Вызов: WorkgroupSender::send
public function send(array $pushList, array $notVisibleGroupsUsers): void
{
	if (
		!ModuleManager::isModuleInstalled('pull')
		|| !Loader::includeModule('pull')
	)
	{
		return;
	}

	$subscribedUsers = $this->getSubscribedUsers();

	foreach ($pushList as $push)
	{
		$pushCommand = PushEventDictionary::getPushEventType($push['EVENT']);
		$groupId = (int)$push['GROUP_ID'];

		if (empty($pushCommand))
		{
			continue;
		}

		$pushParams = [
			'module_id' => 'socialnetwork',
			'command' => $pushCommand,
			'params' => [ 'GROUP_ID' => $groupId ],
		];

		$recipients = (
			isset($notVisibleGroupsUsers[$groupId])
				? array_intersect($subscribedUsers, $notVisibleGroupsUsers[$groupId])
				: $subscribedUsers
		);

		PushSender::sendPersonalEvent($recipients, $pushCommand, $pushParams);
	}
}