Corrected return values of zeroconf client in order to return true-evaluable values. related to #4051

This commit is contained in:
tomk 2008-08-18 14:20:03 +00:00
parent 9c3c70ad7b
commit 2712786383
2 changed files with 3 additions and 2 deletions

View File

@ -703,7 +703,7 @@ class ClientZeroconf:
if conn.add_stanza(stanza, is_message):
if on_ok:
on_ok()
return 0
return id
if item['address'] in self.ip_to_hash:
hash = self.ip_to_hash[item['address']]
@ -714,7 +714,7 @@ class ClientZeroconf:
if conn.add_stanza(stanza, is_message):
if on_ok:
on_ok()
return 0
return id
# otherwise open new connection
stanza.setID('zero')

View File

@ -462,6 +462,7 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
if ret == -1:
# Contact Offline
self.dispatch('MSGERROR', [jid, '-1', _('Contact is offline. Your message could not be sent.'), None, None, session])
return ret
def send_stanza(self, stanza):
# send a stanza untouched