changed_status event now happens with got_offline/got_online events

This commit is contained in:
Nathan Fritz 2010-04-18 21:16:47 -07:00
parent 09aae38117
commit 35c157f9d8

View file

@ -271,6 +271,7 @@ class basexmpp(object):
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:
@ -278,6 +279,7 @@ class basexmpp(object):
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 = ''