markAsRead method

Future<void> markAsRead(
  1. String conversationId,
  2. String messageId
)

Mark messages as read.

Optimistically resets the local unread count to zero so the badge clears immediately, then queues the remote call.

Implementation

Future<void> markAsRead(String conversationId, String messageId) async {
  _ensureInitialized();
  await _database.resetConversationUnreadCount(conversationId);
  await _outboundQueue.enqueue(
    OutboundOperation.markRead(conversationId, messageId),
  );
}