From f366cd3db6af6af4a6f9f1d52ad2108cadc5e172 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 31 Mar 2004 01:09:07 +0000 Subject: [PATCH] handle error status (need an error icon) --- core/core.py | 6 +++--- plugins/gtkgui/gtkgui.py | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/core.py b/core/core.py index d75c06d0d..70e6d1d49 100644 --- a/core/core.py +++ b/core/core.py @@ -147,10 +147,9 @@ class GajimCore: self.hub.sendPlugin('UNSUBSCRIBED', self.connexions[con], \ prs.getFrom().getBasic()) elif type == 'error': - print "\n\n******** ERROR *******" errmsg = prs._node.kids[0].getData() self.hub.sendPlugin('NOTIFY', self.connexions[con], \ - (prs.getFrom().getBasic(), 'offline', errmsg, \ + (prs.getFrom().getBasic(), 'error', errmsg, \ prs.getFrom().getResource())) # END presenceCB @@ -160,6 +159,7 @@ class GajimCore: if self.connected[self.connexions[con]] == 1: self.connected[self.connexions[con]] = 0 con.disconnect() + del self.connexions[con] self.hub.sendPlugin('STATUS', self.connexions[con], 'offline') # END disconenctedCB @@ -175,7 +175,6 @@ class GajimCore: connection=common.xmlstream.TCP, port=5222) #debug = [common.jabber.DBG_ALWAYS], log = sys.stderr, \ #connection=common.xmlstream.TCP_SSL, port=5223) - self.connexions[con] = account try: con.connect() except IOError, e: @@ -206,6 +205,7 @@ class GajimCore: self.hub.sendPlugin('ROSTER', account, roster) con.sendInitPresence() self.hub.sendPlugin('STATUS', account, 'online') + self.connexions[con] = account self.connected[account] = 1 return con else: diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index 2f80eb56a..0dcf6a901 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -1139,7 +1139,8 @@ class roster_Window: else: user.groups.append('general') - if user.show == 'offline' and not showOffline and not 'Agents' in user.groups: + if (user.show == 'offline' or user.show == 'error') and not showOffline\ + and not 'Agents' in user.groups: return model = self.tree.get_model() @@ -1251,7 +1252,7 @@ class roster_Window: self.add_user_to_roster(user, account) else: model = self.tree.get_model() - if show == 'offline' and not showOffline: + if (show == 'offline' or show == 'error') and not showOffline: self.remove_user(user, account) else: for i in iters: @@ -1622,7 +1623,7 @@ class roster_Window: iconstyle = 'sun' self.path = 'plugins/gtkgui/icons/' + iconstyle + '/' self.pixbufs = {} - for state in ('online', 'away', 'xa', 'dnd', 'offline', \ + for state in ('online', 'away', 'xa', 'dnd', 'offline', 'error', \ 'requested', 'message', 'opened', 'closed', 'not in list'): # try to open a pixfile with the correct method files = []