- Модуль: im
- Путь к файлу: ~/bitrix/modules/im/lib/V2/Chat.php
- Класс: BitrixImV2Chat
- Вызов: Chat::sendPushUnreadSelf
protected function sendPushUnreadSelf(int $unreadToId, int $lastId, int $counter, ?array $lastMessageStatuses): void
{
$selfRelation = $this->getSelfRelation();
$muted = isset($selfRelation) ? $selfRelation->getNotifyBlock() : false;
BitrixPullEvent::add($this->getContext()->getUserId(), [
'module_id' => 'im',
'command' => 'unreadMessageChat',
'params' => [
'dialogId' => $this->getDialogId(),
'chatId' => $this->chatId,
'lastId' => $lastId,
'date' => new DateTime(),
'counter' => $counter,
'muted' => $muted ?? false,
'unread' => ImRecent::isUnread($this->getContext()->getUserId(), $this->getType(), $this->getDialogId()),
'lines' => $this->getType() === IM_MESSAGE_OPEN_LINE,
'unreadToId' => $unreadToId,
'lastMessageStatuses' => $lastMessageStatuses ?? [],
'lastMessageViews' => ImCommon::toJson($this->getLastMessageViews()),
],
'push' => ['badge' => 'Y'],
'extra' => BitrixImCommon::getPullExtra()
]);
}