Skip to content

Commit

Permalink
fix(message-service): fix receiving messages from channels not loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
jrainville committed Jan 27, 2023
1 parent 8bb9da6 commit 6c1e16b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/app_service/service/message/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,13 @@ QtObject:
if(chats[i].chatType == ChatType.OneToOne and not self.contactService.getContactById(chatId).isContact):
continue

let currentChatCursor = self.initOrGetMessageCursor(chatId)
# Ignore messages update if chat haven't loaded any messages and try to load them from database instead
if(currentChatCursor.isEmpty()):
currentChatCursor.makeObsolete()
self.asyncLoadMoreMessagesForChat(chatId)
continue

var chatMessages: seq[MessageDto]
for msg in messages:
if(msg.localChatId != chatId):
continue

# Ignore messages older than current chat cursor
let currentChatCursor = self.initOrGetMessageCursor(chatId)
let msgCursorValue = initCursorValue(msg.id, msg.clock)
if(not currentChatCursor.isLessThan(msgCursorValue)):
currentChatCursor.makeObsolete()
Expand Down

0 comments on commit 6c1e16b

Please sign in to comment.