diff --git a/src/common/zeroconf/client_zeroconf.py b/src/common/zeroconf/client_zeroconf.py index a643454fa..7b3459cde 100644 --- a/src/common/zeroconf/client_zeroconf.py +++ b/src/common/zeroconf/client_zeroconf.py @@ -689,8 +689,9 @@ 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 not stanza.getID(): + id_ = conn.Dispatcher.getAnID() + stanza.setID(id_) if conn.add_stanza(stanza, is_message): if on_ok: on_ok(id_) @@ -699,14 +700,16 @@ 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 not stanza.getID(): + id_ = conn.Dispatcher.getAnID() + stanza.setID(id_) if conn.add_stanza(stanza, is_message): if on_ok: on_ok(id_) # otherwise open new connection - stanza.setID('zero') + if not stanza.getID(): + stanza.setID('zero') P2PClient(None, item['address'], item['port'], self, [(stanza, is_message)], to, on_ok=on_ok, on_not_ok=on_not_ok)