Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
bind.php
1<?php
3
4class Bind
5{
7 protected static $statusHandler = null;
8
14 public function start()
15 {
16 self::$statusHandler = new StatusHandler();
17 \Bitrix\Replica\Client\HandlersManager::register(self::$statusHandler);
18 \Bitrix\Replica\Client\HandlersManager::register(new ChatHandler());
19 \Bitrix\Replica\Client\HandlersManager::register(new RelationHandler());
20 \Bitrix\Replica\Client\HandlersManager::register(new MessageHandler());
21 \Bitrix\Replica\Client\HandlersManager::register(new MessageParamHandler());
22 \Bitrix\Replica\Client\HandlersManager::register(new StartWritingHandler());
23
24 $eventManager = \Bitrix\Main\EventManager::getInstance();
25
26 //$eventManager->addEventHandler("main", "OnUserSetLastActivityDate", array(self::$statusHandler, "OnUserSetLastActivityDate"));
27 \Bitrix\Replica\Server\Event::registerOperation("im_status_update", array(self::$statusHandler, "handleStatusUpdateOperation"));
28
29 $eventManager->addEventHandler("socialservices", "OnAfterRegisterUserByNetwork", array(self::$statusHandler, "OnStartUserReplication"), false, 200);
30 \Bitrix\Replica\Server\Event::registerOperation("im_status_bind", array(self::$statusHandler, "handleStatusBindOperation"));
31
32 $eventManager->addEventHandler("im", "OnAfterRecentDelete", array(self::$statusHandler, "OnAfterRecentDelete"));
33 \Bitrix\Replica\Server\Event::registerOperation("im_status_unbind", array(self::$statusHandler, "handleStatusUnbindOperation"));
34
35 $eventManager->addEventHandler("im", "OnAfterRecentAdd", array(self::$statusHandler, "OnAfterRecentAdd"));
36 \Bitrix\Replica\Server\Event::registerOperation("im_status_rebind", array(self::$statusHandler, "handleStatusRebindOperation"));
37 }
38
39}
static $statusHandler
Definition bind.php:7