- Модуль: im
- Путь к файлу: ~/bitrix/modules/im/lib/V2/Chat/OpenLineChat.php
- Класс: BitrixImV2ChatOpenLineChat
- Вызов: OpenLineChat::read
public function read(bool $onlyRecent = false, bool $byEvent = false, bool $forceRead = false): Result
{
Recent::unread($this->getDialogId(), false, $this->getContext()->getUserId());
if ($onlyRecent)
{
$lastId = $this->getReadService()->getLastMessageIdInChat($this->chatId);
return (new Result())->setResult([
'CHAT_ID' => $this->chatId,
'LAST_ID' => $lastId,
'COUNTER' => $this->getReadService()->getCounterService()->getByChat($this->chatId),
'VIEWED_MESSAGES' => [],
]);
}
return $this->readAllMessages($byEvent, $forceRead);
}