handle error status (need an error icon)
This commit is contained in:
parent
96d9ac8e2e
commit
f366cd3db6
2 changed files with 7 additions and 6 deletions
|
@ -147,10 +147,9 @@ class GajimCore:
|
||||||
self.hub.sendPlugin('UNSUBSCRIBED', self.connexions[con], \
|
self.hub.sendPlugin('UNSUBSCRIBED', self.connexions[con], \
|
||||||
prs.getFrom().getBasic())
|
prs.getFrom().getBasic())
|
||||||
elif type == 'error':
|
elif type == 'error':
|
||||||
print "\n\n******** ERROR *******"
|
|
||||||
errmsg = prs._node.kids[0].getData()
|
errmsg = prs._node.kids[0].getData()
|
||||||
self.hub.sendPlugin('NOTIFY', self.connexions[con], \
|
self.hub.sendPlugin('NOTIFY', self.connexions[con], \
|
||||||
(prs.getFrom().getBasic(), 'offline', errmsg, \
|
(prs.getFrom().getBasic(), 'error', errmsg, \
|
||||||
prs.getFrom().getResource()))
|
prs.getFrom().getResource()))
|
||||||
# END presenceCB
|
# END presenceCB
|
||||||
|
|
||||||
|
@ -160,6 +159,7 @@ class GajimCore:
|
||||||
if self.connected[self.connexions[con]] == 1:
|
if self.connected[self.connexions[con]] == 1:
|
||||||
self.connected[self.connexions[con]] = 0
|
self.connected[self.connexions[con]] = 0
|
||||||
con.disconnect()
|
con.disconnect()
|
||||||
|
del self.connexions[con]
|
||||||
self.hub.sendPlugin('STATUS', self.connexions[con], 'offline')
|
self.hub.sendPlugin('STATUS', self.connexions[con], 'offline')
|
||||||
# END disconenctedCB
|
# END disconenctedCB
|
||||||
|
|
||||||
|
@ -175,7 +175,6 @@ class GajimCore:
|
||||||
connection=common.xmlstream.TCP, port=5222)
|
connection=common.xmlstream.TCP, port=5222)
|
||||||
#debug = [common.jabber.DBG_ALWAYS], log = sys.stderr, \
|
#debug = [common.jabber.DBG_ALWAYS], log = sys.stderr, \
|
||||||
#connection=common.xmlstream.TCP_SSL, port=5223)
|
#connection=common.xmlstream.TCP_SSL, port=5223)
|
||||||
self.connexions[con] = account
|
|
||||||
try:
|
try:
|
||||||
con.connect()
|
con.connect()
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
|
@ -206,6 +205,7 @@ class GajimCore:
|
||||||
self.hub.sendPlugin('ROSTER', account, roster)
|
self.hub.sendPlugin('ROSTER', account, roster)
|
||||||
con.sendInitPresence()
|
con.sendInitPresence()
|
||||||
self.hub.sendPlugin('STATUS', account, 'online')
|
self.hub.sendPlugin('STATUS', account, 'online')
|
||||||
|
self.connexions[con] = account
|
||||||
self.connected[account] = 1
|
self.connected[account] = 1
|
||||||
return con
|
return con
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1139,7 +1139,8 @@ class roster_Window:
|
||||||
else:
|
else:
|
||||||
user.groups.append('general')
|
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
|
return
|
||||||
|
|
||||||
model = self.tree.get_model()
|
model = self.tree.get_model()
|
||||||
|
@ -1251,7 +1252,7 @@ class roster_Window:
|
||||||
self.add_user_to_roster(user, account)
|
self.add_user_to_roster(user, account)
|
||||||
else:
|
else:
|
||||||
model = self.tree.get_model()
|
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)
|
self.remove_user(user, account)
|
||||||
else:
|
else:
|
||||||
for i in iters:
|
for i in iters:
|
||||||
|
@ -1622,7 +1623,7 @@ class roster_Window:
|
||||||
iconstyle = 'sun'
|
iconstyle = 'sun'
|
||||||
self.path = 'plugins/gtkgui/icons/' + iconstyle + '/'
|
self.path = 'plugins/gtkgui/icons/' + iconstyle + '/'
|
||||||
self.pixbufs = {}
|
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'):
|
'requested', 'message', 'opened', 'closed', 'not in list'):
|
||||||
# try to open a pixfile with the correct method
|
# try to open a pixfile with the correct method
|
||||||
files = []
|
files = []
|
||||||
|
|
Loading…
Add table
Reference in a new issue