From 03e90746b9c226923c8486c3e445da6471cc4998 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 19 Oct 2010 07:03:45 +0200 Subject: [PATCH] some message handling fixes. see #5982. There are still problems with encrypted messages. --- src/common/connection_handlers.py | 13 +++++++------ src/common/connection_handlers_events.py | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 7e1936add..325745ab1 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1426,7 +1426,7 @@ ConnectionJingle, ConnectionIBBytestream): if obj.receipt_request_tag and gajim.config.get_per('accounts', self.name, 'answer_receipts') and ((contact and contact.sub \ not in (u'to', u'none')) or gc_contact) and obj.mtype != 'error': - receipt = common.xmpp.Message(to=obj.jfid, typ='chat') + receipt = common.xmpp.Message(to=obj.fjid, typ='chat') receipt.setID(obj.id_) receipt.setTag('received', namespace='urn:xmpp:receipts', attrs={'id': obj.id_}) @@ -1436,9 +1436,9 @@ ConnectionJingle, ConnectionIBBytestream): self.connection.send(receipt) # We got our message's receipt - if obj.receipt_received_tag and self.session.control and \ + if obj.receipt_received_tag and obj.session.control and \ gajim.config.get_per('accounts', self.name, 'request_receipt'): - self.session.control.conv_textview.hide_xep0184_warning(obj.id_) + obj.session.control.conv_textview.hide_xep0184_warning(obj.id_) if obj.enc_tag and self.USE_GPG: encmsg = obj.enc_tag.getData() @@ -1472,10 +1472,11 @@ ConnectionJingle, ConnectionIBBytestream): gajim.nec.push_incoming_event(GcInvitationReceivedEvent(None, conn=self, msg_obj=obj)) else: - if isinstance(session, gajim.default_session_type): - session.received(frm, msgtxt, tim, encrypted, msg) + if isinstance(obj.session, gajim.default_session_type): + obj.session.received(obj.fjid, obj.msgtxt, obj.timestamp, + obj.encrypted, obj.stanza) else: - session.received(msg) + obj.session.received(obj.stanza) # process and dispatch an error message def dispatch_error_message(self, msg, msgtxt, session, frm, tim): diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index af40511a2..917ddaf3b 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -1016,6 +1016,7 @@ class DecryptedMessageReceivedEvent(nec.NetworkIncomingEvent): self.gc_control = self.msg_obj.gc_control self.session = self.msg_obj.session self.timestamp = self.msg_obj.timestamp + self.encrypted = self.msg_obj.encrypted return True class GcMessageReceivedEvent(nec.NetworkIncomingEvent):