changeset d124d2e5bdda in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=d124d2e5bdda description: fix traceback. Fixes #7103
diffstat:
src/common/zeroconf/client_zeroconf.py | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r bb953b80836e -r d124d2e5bdda src/common/zeroconf/client_zeroconf.py --- a/src/common/zeroconf/client_zeroconf.py Tue Feb 14 19:24:16 2012 +0400 +++ b/src/common/zeroconf/client_zeroconf.py Tue Feb 14 19:35:09 2012 +0100 @@ -803,11 +803,19 @@ def on_ok(_waitid): # if timeout: # self._owner.set_timeout(timeout) - to = stanza.getTo() + to = unicode(stanza.getTo()) + to = gajim.get_jid_without_resource(to) + + try: + item = self.roster[to] + except KeyError: + # Contact offline + item = None + conn = None if to in self.recipient_to_hash: conn = self.connections[self.recipient_to_hash[to]] - elif item['address'] in self.ip_to_hash: + elif item and item['address'] in self.ip_to_hash: hash_ = self.ip_to_hash[item['address']] if self.hash_to_port[hash_] == item['port']: conn = self.connections[hash_]