Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ExtendPullWatchPrefilter.php
1<?php
2
4
11
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}