diff options
Diffstat (limited to 'src/core.py')
-rw-r--r-- | src/core.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py index b2f5a398..b8aaf18e 100644 --- a/src/core.py +++ b/src/core.py @@ -245,6 +245,7 @@ class Core(object): self.xmpp.add_event_handler("got_offline" , self.on_got_offline) self.xmpp.add_event_handler("roster_update", self.on_roster_update) self.xmpp.add_event_handler("changed_status", self.on_presence) + self.xmpp.add_event_handler("presence_error", self.on_presence_error) self.xmpp.add_event_handler("roster_subscription_request", self.on_subscription_request) self.xmpp.add_event_handler("roster_subscription_authorized", self.on_subscription_authorized) self.xmpp.add_event_handler("roster_subscription_remove", self.on_subscription_remove) @@ -2850,6 +2851,7 @@ class Core(object): tab.unlock() if contact is None: return + contact.error = None self.events.trigger('normal_presence', presence, contact[jid.full]) tab = self.get_conversation_by_jid(jid, create=False) if isinstance(self.current_tab(), tabs.RosterInfoTab): @@ -2858,6 +2860,13 @@ class Core(object): tab.refresh() self.doupdate() + def on_presence_error(self, presence): + jid = presence['from'] + contact = roster[jid.bare] + if not contact: + return + contact.error = presence['error']['type'] + ': ' + presence['error']['condition'] + def on_got_offline(self, presence): """ A JID got offline |