• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/ReadService.php
  • Класс: BitrixImV2MessageReadService
  • Вызов: ReadService::read
public function read(MessageCollection $messages, Chat $chat): Result
{
	$maxId = max($messages->getIds());
	$this->setLastIdForRead($maxId, $chat->getChatId());
	$this->counterService->deleteTo($messages[$maxId]);
	$counter = $this->counterService->getByChat($chat->getChatId());
	$time = microtime(true);
	$this->viewedService->add($messages);
	$this->updateDateRecent($chat->getChatId());
	$this->sendPush($chat->getChatId(), [$this->getContext()->getUserId()], $counter, $time);

	return (new Result())->setResult(['COUNTER' => $counter]);
}