3namespace Bitrix\Im\V2\Chat;
7use Bitrix\Im\V2\Message\ReadService;
8use Bitrix\Main\Config\Option;
10use Bitrix\Main\Localization\Loc;
11use Bitrix\Main\Type\DateTime;
15 private const MESSAGE_COMPONENT_START_CHANNEL =
'ChannelCreationMessage';
19 if (!Loader::includeModule(
'pull'))
24 \CPullWatch::Add($this->getContext()->getUserId(),
"IM_PUBLIC_COMMENT_{$this->getId()}",
true);
29 $result = parent::updateStateAfterRelationsAdd($usersToAdd);
37 $messageText = Loc::getMessage(
'IM_CHANNEL_CREATE');
40 'MESSAGE_TYPE' => $this->
getType(),
41 'TO_CHAT_ID' => $this->getChatId(),
43 'MESSAGE' => $messageText,
46 'SKIP_COUNTER_INCREMENTS' =>
'Y',
55 return self::IM_TYPE_CHANNEL;
60 return self::MANAGE_RIGHTS_MANAGERS;
65 return self::MANAGE_RIGHTS_MANAGERS;
70 $readComments = (
new ReadService())->readChildren($this);
72 if (empty($readComments) || !Loader::includeModule(
'pull'))
79 'command' =>
'readAllChannelComments',
81 'chatId' => $this->getChatId(),
89 protected function sendBanner(?
int $authorId =
null): void
92 'MESSAGE_TYPE' => $this->
getType(),
93 'TO_CHAT_ID' => $this->getChatId(),
95 'MESSAGE' => Loc::getMessage(
'IM_CHAT_CHANNEL_CREATE_WELCOME'),
99 'COMPONENT_ID' => self::MESSAGE_COMPONENT_START_CHANNEL,
101 'SKIP_COUNTER_INCREMENTS' =>
'Y',
static getType($chatData, bool $camelCase=true)
static raiseChat(\Bitrix\Im\V2\Chat $chat, RelationCollection $relations, ?DateTime $lastActivity=null)
updateStateAfterRelationsAdd(array $usersToAdd)
needToSendMessageUserDelete()
sendBanner(?int $authorId=null)
sendGreetingMessage(?int $authorId=null)
getDefaultManageMessages()
static add($recipient, array $parameters, $channelType=\CPullChannel::TYPE_PRIVATE)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)