From b467c031b9725ca27f70befd613f11e3184d2c9c Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Thu, 27 Jan 2022 10:24:37 +0100 Subject: [PATCH] fix(@desktop/chat): can't reply to a reply fixes #4551 --- src/app_service/service/chat/service.nim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app_service/service/chat/service.nim b/src/app_service/service/chat/service.nim index 91f13dbe7e..a7d4d41c2e 100644 --- a/src/app_service/service/chat/service.nim +++ b/src/app_service/service/chat/service.nim @@ -128,14 +128,18 @@ QtObject: error "no chats or messages in the parsed response" return - # This fixes issue#3490 + # The reason why we are sending all the messages with responseTo filled in is because + # the reposnse from status_go doesnt necessarily contain the last reply on the 0th position. + var isaReply = false var msg = messages[0] for m in messages: if(m.responseTo.len > 0): + isaReply = true msg = m - break - - self.events.emit(SIGNAL_SENDING_SUCCESS, MessageSendingSuccess(message: msg, chat: chats[0])) + self.events.emit(SIGNAL_SENDING_SUCCESS, MessageSendingSuccess(message: msg, chat: chats[0])) + + if not isaReply: + self.events.emit(SIGNAL_SENDING_SUCCESS, MessageSendingSuccess(message: msg, chat: chats[0])) proc processUpdateForTransaction*(self: Service, messageId: string, response: RpcResponse[JsonNode]) = var (chats, messages) = self.processMessageUpdateAfterSend(response)