onMessageReceived method
void
onMessageReceived(
- dynamic chatMessageModel
Implementation
void onMessageReceived(chatMessageModel) {
mirrorFlyLog("chatController", "onMessageReceived");
if (chatMessageModel.chatUserJid == profile.jid) {
removeUnreadSeparator();
final index = chatList.indexWhere((message) => message.messageId == chatMessageModel.messageId);
debugPrint("message received index $index");
if (index.isNegative) {
chatList.insert(0, chatMessageModel);
unreadCount.value++;
//scrollToBottom();
if(SessionManagement.getCurrentChatJID() != Constants.emptyString){
setOnGoingUserAvail();
}
}
}
}