• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Chat.php
  • Класс: BitrixImV2Chat
  • Вызов: Chat::sendPushReadSelf
protected function sendPushReadSelf(MessageCollection $messages, int $lastId, int $counter): void
{
	$selfRelation = $this
		->getRelations(['SELECT' => ['ID', 'CHAT_ID', 'USER_ID', 'NOTIFY_BLOCK']])
		->getByUserId($this->getContext()->getUserId(), $this->chatId)
	;
	$muted = isset($selfRelation) ? $selfRelation->getNotifyBlock() : false;
	BitrixPullEvent::add($this->getContext()->getUserId(), [
		'module_id' => 'im',
		'command' => 'readMessageChat',
		'params' => [
			'dialogId' => $this->getDialogId(),
			'chatId' => $this->getChatId(),
			'lastId' => $lastId,
			'counter' => $counter,
			'muted' => $muted ?? false,
			'unread' => ImRecent::isUnread($this->getContext()->getUserId(), $this->getType(), $this->getDialogId()),
			'lines' => $this->getType() === IM_MESSAGE_OPEN_LINE,
			'viewedMessages' => $messages->getIds(),
		],
		'extra' => BitrixImCommon::getPullExtra()
	]);
}