updateUnreadCount method

bool updateUnreadCount(
  1. BaseMessage message
)

Implementation

bool updateUnreadCount(BaseMessage message) {
  final currentUser = chat.chatContext.currentUser;

  if (!message.isSilent) {
    if (message is AdminMessage) {
      _increaseUnreadMessageCount();
      return true;
    }

    if (message.sender?.isCurrentUser == false) {
      _increaseUnreadMessageCount();
      return true;
    }

    if (message.mentioned(user: currentUser, byOtherUser: message.sender)) {
      increaseUnreadMentionCount();
      return true;
    }
  }
  return false;
}