Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/socialnetwork/lib/Space/Role/Event/ |
Upload File : |
<?php namespace Bitrix\Socialnetwork\Space\Role\Event; use Bitrix\Main\Loader; use Bitrix\Main\ModuleManager; use Bitrix\Socialnetwork\Integration\Pull\PushService; use Bitrix\Socialnetwork\Internals\EventService\Event; use Bitrix\Socialnetwork\Internals\EventService\EventDictionary; use Bitrix\Socialnetwork\Internals\EventService\Push\PushEventDictionary; use Bitrix\Socialnetwork\Internals\EventService\Recepients\Recepient; final class Service { public const SUPPORTED_EVENTS = [ EventDictionary::EVENT_SPACE_USER_ROLE_CHANGE, ]; public function processEvent(Event $event, Recepient $recipient): void { if (!ModuleManager::isModuleInstalled('pull') || !Loader::includeModule('pull')) { return; } if (in_array($event->getType(), self::SUPPORTED_EVENTS) && $recipient->isOnline()) { $recipients = [$recipient->getId()]; $userId = $event->getUserId(); $spaceId = $event->getGroupId(); PushService::addEvent($recipients, [ 'module_id' => PushService::MODULE_NAME, 'command' => PushEventDictionary::getPushEventType($event->getType()), 'params' => [ 'USER_ID' => $userId, 'GROUP_ID' => $spaceId, ], ]); } } }