some message handling fixes. see #5982. There are still problems with encrypted messages.

This commit is contained in:
Yann Leboulanger 2010-10-19 07:03:45 +02:00
parent e4ff7c6ced
commit 03e90746b9
2 changed files with 8 additions and 6 deletions

View File

@ -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):

View File

@ -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):