• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Chat/PrivateChat.php
  • Класс: BitrixImV2ChatPrivateChat
  • Вызов: PrivateChat::sendPushReadOpponent
protected function sendPushReadOpponent(MessageCollection $messages, int $lastId): array
{
	$companionId = $this->getDialogId();
	$pushMessage = [
		'module_id' => 'im',
		'command' => 'readMessageOpponent',
		'expiry' => 3600,
		'params' => [
			'dialogId' => $this->getContext()->getUserId(),
			'chatId' => $this->getChatId(),
			'userId' =>  $this->getContext()->getUserId(),
			'userName' => User::getInstance($this->getContext()->getUserId())->getFullName(false),
			'lastId' => $lastId,
			'date' => (new DateTime())->format('c'),
			'chatMessageStatus' => $this->getReadService()->getChatMessageStatus($this->getChatId()),
			'viewedMessages' => $messages->getIds(),
		],
		'extra' => BitrixImCommon::getPullExtra()
	];
	BitrixPullEvent::add($companionId, $pushMessage);

	return $pushMessage;
}