fix(edit): don't send new message event on edits

Fixes #10108

We were sending SIGNAL_NEW_MESSAGE_RECEIVED and SIGNAL_MESSAGE_EDITED, but the former is not needed, because the message editing is all done with the latter.
The new message signal was sending the OS notification, which is not wanted, plus it did some useless processing, like trying to re-edit the message model, when it was already done.
This commit is contained in:
Jonathan Rainville 2023-03-31 13:39:54 -04:00
parent de5f0cb960
commit e86a625b92
1 changed files with 4 additions and 4 deletions

View File

@ -248,17 +248,17 @@ QtObject:
continue
# Ignore messages older than current chat cursor
if(self.isChatCursorInitialized(chatId)):
if self.isChatCursorInitialized(chatId):
let currentChatCursor = self.initOrGetMessageCursor(chatId)
let msgCursorValue = initCursorValue(msg.id, msg.clock)
if(not currentChatCursor.isLessThan(msgCursorValue)):
currentChatCursor.makeObsolete()
continue
if(msg.editedAt > 0):
if msg.editedAt > 0:
let data = MessageEditedArgs(chatId: msg.localChatId, message: msg)
self.events.emit(SIGNAL_MESSAGE_EDITED, data)
else:
chatMessages.add(msg)
let data = MessagesArgs(