mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-30 19:19:55 +00:00
tweaked presence handler
This commit is contained in:
parent
5e736f4b97
commit
ac1d76b23d
1 changed files with 2 additions and 1 deletions
|
@ -267,7 +267,7 @@ class basexmpp(object):
|
||||||
wasoffline = True
|
wasoffline = True
|
||||||
self.roster[jid]['presence'][resource] = {'show': show, 'status': status, 'priority': priority}
|
self.roster[jid]['presence'][resource] = {'show': show, 'status': status, 'priority': priority}
|
||||||
else:
|
else:
|
||||||
if self.roster[jid]['presence'][resource].get('show', None) == 'unavailable':
|
if self.roster[jid]['presence'][resource].get('show', 'unavailable') == 'unavailable':
|
||||||
wasoffline = True
|
wasoffline = True
|
||||||
self.roster[jid]['presence'][resource] = {'show': show, 'status': status}
|
self.roster[jid]['presence'][resource] = {'show': show, 'status': status}
|
||||||
self.roster[jid]['presence'][resource]['priority'] = priority
|
self.roster[jid]['presence'][resource]['priority'] = priority
|
||||||
|
@ -276,6 +276,7 @@ class basexmpp(object):
|
||||||
self.event("got_online", presence)
|
self.event("got_online", presence)
|
||||||
elif not wasoffline and show == 'unavailable':
|
elif not wasoffline and show == 'unavailable':
|
||||||
self.event("got_offline", presence)
|
self.event("got_offline", presence)
|
||||||
|
logging.debug("%s %s got offline" % (jid, resource))
|
||||||
if len(self.roster[jid]['presence']) > 1:
|
if len(self.roster[jid]['presence']) > 1:
|
||||||
del self.roster[jid]['presence'][resource]
|
del self.roster[jid]['presence'][resource]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue