summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-04-07 16:23:24 -0400
committerLance Stout <lancestout@gmail.com>2012-04-07 16:23:24 -0400
commit9f855b9679952ae28c01f3d1f53c978e20f4e833 (patch)
treed13c0f0b3424ef0af1c2510d807e249392d79231
parentaedbecd6735f6075f871412817f97639bf1365ec (diff)
downloadslixmpp-9f855b9679952ae28c01f3d1f53c978e20f4e833.tar.gz
slixmpp-9f855b9679952ae28c01f3d1f53c978e20f4e833.tar.bz2
slixmpp-9f855b9679952ae28c01f3d1f53c978e20f4e833.tar.xz
slixmpp-9f855b9679952ae28c01f3d1f53c978e20f4e833.zip
Trigger got_online after resource information has been saved.
-rw-r--r--sleekxmpp/roster/item.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sleekxmpp/roster/item.py b/sleekxmpp/roster/item.py
index 9cb278a4..6ed1e42d 100644
--- a/sleekxmpp/roster/item.py
+++ b/sleekxmpp/roster/item.py
@@ -356,13 +356,14 @@ class RosterItem(object):
data = {'status': presence['status'],
'show': presence['show'],
'priority': presence['priority']}
- if not self.resources:
- self.xmpp.event('got_online', presence)
+ got_online = not self.resources
if resource not in self.resources:
self.resources[resource] = {}
old_status = self.resources[resource].get('status', '')
old_show = self.resources[resource].get('show', None)
self.resources[resource].update(data)
+ if got_online:
+ self.xmpp.event('got_online', presence)
if old_show != presence['show'] or old_status != presence['status']:
self.xmpp.event('changed_status', presence)