From 0f2ddd50c490a3b34ddcd12755ae6c562a5f82bd Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 28 Sep 2010 15:51:26 +0200 Subject: [PATCH] fix some tracebacks when adding / removing a contact. Fixes #5946 --- src/common/connection_handlers.py | 5 +++-- src/common/connection_handlers_events.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index d84ff0a53..17a9b33dd 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1773,7 +1773,8 @@ ConnectionJingle, ConnectionIBBytestream): break if obj.contact: - obj.old_show = statuss.index(obj.contact.show) + if obj.contact.show in statuss: + obj.old_show = statuss.index(obj.contact.show) # nick changed if obj.contact_nickname is not None and \ obj.contact.contact_name != obj.contact_nickname: @@ -1800,7 +1801,7 @@ ConnectionJingle, ConnectionIBBytestream): resource=obj.resource) gajim.contacts.add_contact(account, obj.contact) obj.contact_list.append(obj.contact) - else: + elif obj.contact.show in statuss: obj.old_show = statuss.index(obj.contact.show) if (resources != [''] and (len(obj.contact_list) != 1 or \ obj.contact_list[0].show != 'offline')) and \ diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index 2430c9463..4811051be 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -772,7 +772,7 @@ class PresenceReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): gajim.config.set_per('account', self.conn.name, 'dont_ack_subscription', True) else: - self.dispatch('UNSUBSCRIBED', self.jid) + self.conn.dispatch('UNSUBSCRIBED', self.jid) elif self.ptype == 'error': errmsg = self.iq_obj.getError() errcode = self.iq_obj.getErrorCode()