mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-18 01:27:25 +00:00
fix(message-service): fix receiving messages from channels not loaded
This commit is contained in:
parent
8bb9da6fcc
commit
6c1e16b72e
@ -240,19 +240,13 @@ QtObject:
|
|||||||
if(chats[i].chatType == ChatType.OneToOne and not self.contactService.getContactById(chatId).isContact):
|
if(chats[i].chatType == ChatType.OneToOne and not self.contactService.getContactById(chatId).isContact):
|
||||||
continue
|
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]
|
var chatMessages: seq[MessageDto]
|
||||||
for msg in messages:
|
for msg in messages:
|
||||||
if(msg.localChatId != chatId):
|
if(msg.localChatId != chatId):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Ignore messages older than current chat cursor
|
# Ignore messages older than current chat cursor
|
||||||
|
let currentChatCursor = self.initOrGetMessageCursor(chatId)
|
||||||
let msgCursorValue = initCursorValue(msg.id, msg.clock)
|
let msgCursorValue = initCursorValue(msg.id, msg.clock)
|
||||||
if(not currentChatCursor.isLessThan(msgCursorValue)):
|
if(not currentChatCursor.isLessThan(msgCursorValue)):
|
||||||
currentChatCursor.makeObsolete()
|
currentChatCursor.makeObsolete()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user