diff --git a/src/common/gajim.py b/src/common/gajim.py index a6433923ae4b591702cfba2ab68279e96cd968b0..428b6cae2e89fe4f6f3b69ad40769289ee63d8d5 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -222,6 +222,12 @@ caps_hash = {} import caps_cache caps_cache.initialize(logger) +global_id = 0 +def get_an_id(): + global global_id + global_id += 1 + return global_id + def get_nick_from_jid(jid): pos = jid.find('@') return jid[:pos] diff --git a/src/common/jingle_transport.py b/src/common/jingle_transport.py index 224566a007a6b25ff424baed7206016e9ed0d1c0..dabd8ce0badc51e245097286f6127ecb542571fc 100644 --- a/src/common/jingle_transport.py +++ b/src/common/jingle_transport.py @@ -178,7 +178,7 @@ class JingleTransportSocks5(JingleTransport): local_ip_cand = [] port = int(gajim.config.get('file_transfers_port')) #type preference of connection type. XEP-0260 section 2.2 - type_preference = 126 + type_preference = 126 c = {'host': self.connection.peerhost[0]} c['candidate_id'] = self.connection.connection.getAnID() c['port'] = port @@ -351,6 +351,7 @@ class JingleTransportICEUDP(JingleTransport): 'network': '0', 'port': candidate.port, 'priority': int(candidate.priority), # hack + 'id': gajim.get_an_id() } if candidate.type in types: attrs['type'] = types[candidate.type]