diff options
author | Lance Stout <lancestout@gmail.com> | 2011-11-18 13:37:57 -0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-11-18 13:39:02 -0800 |
commit | 22868c3924529701dd8d86ba32a7c1752a3f6cb5 (patch) | |
tree | f735ccbfa5b4ea1c3b94a750b5993efe9cc5c135 /sleekxmpp | |
parent | 2de1be188cf86e6ebb790938e276ecb85379a5b3 (diff) | |
download | slixmpp-22868c3924529701dd8d86ba32a7c1752a3f6cb5.tar.gz slixmpp-22868c3924529701dd8d86ba32a7c1752a3f6cb5.tar.bz2 slixmpp-22868c3924529701dd8d86ba32a7c1752a3f6cb5.tar.xz slixmpp-22868c3924529701dd8d86ba32a7c1752a3f6cb5.zip |
Fix changed_status event
Once again only fires when a resource's presence show value changes.
Diffstat (limited to 'sleekxmpp')
-rw-r--r-- | sleekxmpp/basexmpp.py | 2 | ||||
-rw-r--r-- | sleekxmpp/roster/item.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index 59a79b78..8f11eefa 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -778,8 +778,6 @@ class BaseXMPP(XMLStream): not presence['type'] in presence.showtypes: return - self.event("changed_status", presence) - def exception(self, exception): """ Process any uncaught exceptions, notably IqError and diff --git a/sleekxmpp/roster/item.py b/sleekxmpp/roster/item.py index 1520f770..c27f7a78 100644 --- a/sleekxmpp/roster/item.py +++ b/sleekxmpp/roster/item.py @@ -345,7 +345,10 @@ class RosterItem(object): self.xmpp.event('got_online', presence) if resource not in self.resources: self.resources[resource] = {} + old_show = self.resources[resource].get('show', None) self.resources[resource].update(data) + if old_show != presence['show']: + self.xmpp.event('changed_status', presence) def handle_unavailable(self, presence): resource = presence['from'].resource @@ -353,6 +356,7 @@ class RosterItem(object): return if resource in self.resources: del self.resources[resource] + self.xmpp.event('changed_status', presence) if not self.resources: self.xmpp.event('got_offline', presence) |