fix sending zeroconf messages

This commit is contained in:
Yann Leboulanger 2014-10-12 15:16:17 +02:00
parent 7af365edda
commit da5bfa74c6
1 changed files with 18 additions and 18 deletions

View File

@ -337,12 +337,14 @@ class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf):
if obj.account != self.name:
return
def cb(jid, msg, keyID, forward_from, session, original_message, subject,
type_, msg_iq, xhtml):
def on_send_ok(msg_id):
gajim.nec.push_incoming_event(MessageSentEvent(None, conn=self,
jid=obj.jid, message=obj.message, keyID=obj.keyID,
chatstate=None))
if obj.callback:
obj.callback(obj.msg_id, *obj.callback_args)
obj.callback(msg_iq, *obj.callback_args)
if not obj.is_loggable:
return
@ -355,8 +357,6 @@ class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf):
fjid=obj.jid, error_code=-1, error_msg=reason, msg=None,
time_=None, session=obj.session))
def cb(jid, msg, keyID, forward_from, session, original_message, subject,
type_, msg_iq, xhtml):
ret = self.connection.send(msg_iq, msg is not None, on_ok=on_send_ok,
on_not_ok=on_send_not_ok)