Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ExtendPullWatchPrefilter.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Controller\Filter
;
4
5
use
Bitrix\Im\V2\Chat\OpenChat
;
6
use
Bitrix\Im\V2\Chat\OpenLineChat
;
7
use
Bitrix\Im\V2\Chat\PrivateChat
;
8
use
Bitrix\Im\V2\Message
;
9
use
Bitrix\Main\Engine\ActionFilter\Base
;
10
use
Bitrix\Main\Event
;
11
12
class
ExtendPullWatchPrefilter
extends
Base
13
{
14
public
function
onBeforeAction
(
Event
$event)
15
{
16
$chat = $this->
getAction
()->getArguments()[
'chat'
] ??
null
;
17
18
if
($chat ===
null
)
19
{
20
$message = $this->
getAction
()->getArguments()[
'message'
] ??
null
;
21
if
($message instanceof
Message
)
22
{
23
$chat = $message->getChat();
24
}
25
}
26
27
if
($chat instanceof
OpenChat
|| $chat instanceof
OpenLineChat
)
28
{
29
if
($chat->getSelfRelation() ===
null
)
30
{
31
$chat->extendPullWatch();
32
}
33
}
34
35
return
null
;
36
}
37
}
Bitrix\Im\V2\Chat\OpenChat
Definition
OpenChat.php:12
Bitrix\Im\V2\Chat\OpenLineChat
Definition
OpenLineChat.php:19
Bitrix\Im\V2\Chat\PrivateChat
Definition
PrivateChat.php:33
Bitrix\Im\V2\Controller\Filter\ExtendPullWatchPrefilter
Definition
ExtendPullWatchPrefilter.php:13
Bitrix\Im\V2\Controller\Filter\ExtendPullWatchPrefilter\onBeforeAction
onBeforeAction(Event $event)
Definition
ExtendPullWatchPrefilter.php:14
Bitrix\Im\V2\Message
Definition
Message.php:44
Bitrix\Im\V2\Sync\Event
Definition
Event.php:9
Bitrix\Main\Engine\ActionFilter\Base
Definition
base.php:15
Bitrix\Main\Engine\ActionFilter\Base\getAction
getAction()
Definition
base.php:48
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Im\V2\Controller\Filter
Definition
ActionUuidHandler.php:3
Bitrix\Im\V2\Message
Definition
AdditionalMessagePopupItem.php:3
modules
im
lib
V2
Controller
Filter
ExtendPullWatchPrefilter.php
Создано системой
1.10.0