fix(chat/messages): prevent manipulation of uninitialized cursor
fixes: #9361
This commit is contained in:
parent
7c1b4e37f3
commit
63bbf266a0
|
@ -247,11 +247,12 @@ QtObject:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Ignore messages older than current chat cursor
|
# Ignore messages older than current chat cursor
|
||||||
let currentChatCursor = self.initOrGetMessageCursor(chatId)
|
if(self.isChatCursorInitialized(chatId)):
|
||||||
let msgCursorValue = initCursorValue(msg.id, msg.clock)
|
let currentChatCursor = self.initOrGetMessageCursor(chatId)
|
||||||
if(not currentChatCursor.isLessThan(msgCursorValue)):
|
let msgCursorValue = initCursorValue(msg.id, msg.clock)
|
||||||
currentChatCursor.makeObsolete()
|
if(not currentChatCursor.isLessThan(msgCursorValue)):
|
||||||
continue
|
currentChatCursor.makeObsolete()
|
||||||
|
continue
|
||||||
|
|
||||||
if(msg.editedAt > 0):
|
if(msg.editedAt > 0):
|
||||||
let data = MessageEditedArgs(chatId: msg.localChatId, message: msg)
|
let data = MessageEditedArgs(chatId: msg.localChatId, message: msg)
|
||||||
|
|
Loading…
Reference in New Issue