fix printing of sent zeroconf messages. fixes #4051

This commit is contained in:
Yann Leboulanger 2008-08-04 10:54:56 +00:00
parent 2b896152a2
commit e22c6e9697
1 changed files with 8 additions and 1 deletions

View File

@ -698,6 +698,8 @@ class ClientZeroconf:
# look for hashed connections
if to in self.recipient_to_hash:
conn = self.connections[self.recipient_to_hash[to]]
id = conn.Dispatcher.getAnID()
stanza.setID(id)
if conn.add_stanza(stanza, is_message):
if on_ok:
on_ok()
@ -707,13 +709,18 @@ class ClientZeroconf:
hash = self.ip_to_hash[item['address']]
if self.hash_to_port[hash] == item['port']:
conn = self.connections[hash]
id = conn.Dispatcher.getAnID()
stanza.setID(id)
if conn.add_stanza(stanza, is_message):
if on_ok:
on_ok()
return 0
# otherwise open new connection
stanza.setID('zero')
P2PClient(None, item['address'], item['port'], self,
[(stanza, is_message)], to, on_ok=on_ok, on_not_ok=on_not_ok)
return 'zero'
# vim: se ts=3: