From f4052280419a1357efe0607abc8b015782ac57af Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 5 Mar 2016 14:22:56 +0100 Subject: [PATCH] make last message correction work for carbon copied messages sent from another resource. Fixes #8276 --- src/chat_control.py | 7 +++++++ src/common/connection_handlers_events.py | 1 + 2 files changed, 8 insertions(+) diff --git a/src/chat_control.py b/src/chat_control.py index 204750f9a..43427de1c 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -870,6 +870,13 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): correct_id[1] == self.last_received_id[name]: self.conv_textview.correct_last_received_message(text, xhtml, name, old_txt) + elif correct_id and correct_id[1] and \ + self.conv_textview.last_sent_message_marks[0] and \ + correct_id[1] == self.last_received_id[name]: + # this is for carbon copied messages that are sent from another + # resource + self.conv_textview.correct_last_sent_message(text, xhtml, + self.get_our_nick(), old_txt) else: textview.print_conversation_line(text, jid, kind, name, tim, other_tags_for_name, other_tags_for_time, other_tags_for_text, diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index f4a1e2ca9..108de8b60 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -1150,6 +1150,7 @@ class MessageReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): if forward_tag: msg = forward_tag.getTag('message') self.stanza = nbxmpp.Message(node=msg) + self.get_id() if carbon_marker.getName() == 'sent': to = self.stanza.getTo() frm = self.stanza.getFrom()