Метод readExactly
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulesim/lib/V2/Reading/Reader.php
Исходный код
Сигнатура метода
public function readExactly(MessageCollection $messages, int $userId): ReadResult
Возвращает:
ReadResult
Описание
Marks EXACTLY these messages of a single chat read for a user: clears unread of exactly these messages (NOT "up to a message"), without moving the LAST_ID cursor and without touching other unread chat messages. Event-free: does NOT publish a typed read event ({@see Chat\ExternalChat::onAfterMessagesRead} sends AfterReadMessagesEvent) — otherwise a cross-module cascade would occur (loop-safety in the socialnetwork<->im integration). A durable sync signal to clients (including the mobile local DB via im.v2.Sync.list) is still given directly via {@see Chat::logReadToSync} — without a typed event. Deliberately does NOT reuse {@see Reader::read}: there the counter is cleared "up to a message inclusive" (toMessage) and read events are published. Here it is an exact clear of exactly the passed messages (byMessages). The delete strategy and eventing differ fundamentally, so this is a separate primitive, not a flag/branch of read(). Expects a single-chat message collection (single-chat read-all of collab system messages): the counter is read for one chat, so mixed chats are not supported. Pull is sent with exact=true: the client clears indication exactly (only viewedMessages), without a sweep up to max(ID) and without rolling back the cursor by lastId.
Параметры
2| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$messages
|
MessageCollection
|
-
|
-
|
$userId
|
int
|
-
|
-
|