Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
changed_status event now happens with got_offline/got_online events
  • Loading branch information
fritzy committed Apr 19, 2010
1 parent 09aae38 commit 35c157f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sleekxmpp/basexmpp.py
Expand Up @@ -271,13 +271,15 @@ def _handlePresence(self, presence):
name = self.roster[jid].get('name', '')
if wasoffline and (show == 'available' or show in presence.showtypes):
self.event("got_online", presence)
self.event("changed_status", presence)
elif show == 'unavailable':
logging.debug("%s %s got offline" % (jid, resource))
if len(self.roster[jid]['presence']) > 1:
del self.roster[jid]['presence'][resource]
else:
del self.roster[jid]
self.event("got_offline", presence)
self.event("changed_status", presence)
elif oldroster != self.roster.get(jid, {'presence': {}})['presence'].get(resource, {}):
self.event("changed_status", presence)
name = ''
Expand Down

0 comments on commit 35c157f

Please sign in to comment.