• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/ReadService.php
  • Класс: BitrixImV2MessageReadService
  • Вызов: ReadService::readAllInChat
public function readAllInChat(int $chatId): Result
{
	$lastId = $this->viewedService->getLastMessageIdInChat($chatId) ?? 0;
	$this->setLastIdForRead($lastId, $chatId);
	$this->counterService->deleteByChatId($chatId);
	$time = microtime(true);
	$counter = 0;
	//$this->viewedController->addAllFromChat($chatId);
	$this->updateDateRecent($chatId);
	$this->sendPush($chatId, [$this->getContext()->getUserId()], $counter, $time);

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