summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-03-03 13:13:15 +0100
committermathieui <mathieui@mathieui.net>2013-03-03 13:13:15 +0100
commit3d98f48ba21e83df50e18ea5e7800aad19f5d5b4 (patch)
tree65282ac2e501cd6135f1901fb7950a61b1463ac2 /src/core.py
parentf84e3d19282641944373a0a02b6406fa03f712cd (diff)
downloadpoezio-3d98f48ba21e83df50e18ea5e7800aad19f5d5b4.tar.gz
poezio-3d98f48ba21e83df50e18ea5e7800aad19f5d5b4.tar.bz2
poezio-3d98f48ba21e83df50e18ea5e7800aad19f5d5b4.tar.xz
poezio-3d98f48ba21e83df50e18ea5e7800aad19f5d5b4.zip
Fix #2182 (show s2s errors)
- Add the theming options COLOR_ROSTER_ERROR, CHAR_ROSTER_ERRROR, and CHAR_ROSTER_ASKED
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py9
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