fix(Chat): `ReplyTo` messages with missing message information

Removed code that removed messages marked as `repliedTo` in the corresponding service `handleMessagesUpdate` method.

It solves the following use case:
- New account, join public channel, replay massages shown there.

Fixes #6138
This commit is contained in:
Noelia 2022-06-21 09:51:05 +02:00 committed by Noelia
parent ddf21fdb73
commit e4558c3a05
1 changed files with 0 additions and 14 deletions

View File

@ -158,24 +158,10 @@ QtObject:
# if (not chats[0].active): # if (not chats[0].active):
# return # return
# In case of reply to a message we're receiving 2 messages in the `messages` array (replied message
# and a message one replied to) but we actually need only a new replied message, that's why we need to filter
# messages here.
# We are not sure if we can receive more replies here, also ordering in the `messages` array is not
# the same (once we may have replied messages before once after the messages one replied to), that's why we are
# covering the most general case here.
var messagesOneRepliedTo: seq[string]
for msg in messages: for msg in messages:
if(msg.editedAt > 0): if(msg.editedAt > 0):
let data = MessageEditedArgs(chatId: msg.localChatId, message: msg) let data = MessageEditedArgs(chatId: msg.localChatId, message: msg)
self.events.emit(SIGNAL_MESSAGE_EDITED, data) self.events.emit(SIGNAL_MESSAGE_EDITED, data)
if msg.responseTo.len > 0:
messagesOneRepliedTo.add(msg.responseTo)
for msgId in messagesOneRepliedTo:
removeMessageWithId(messages, msgId)
for i in 0 ..< chats.len: for i in 0 ..< chats.len:
if(chats[i].chatType == ChatType.Unknown): if(chats[i].chatType == ChatType.Unknown):