Trigger got_online after resource information has been saved.

This commit is contained in:
Lance Stout 2012-04-07 16:23:24 -04:00
parent aedbecd673
commit 9f855b9679

View file

@ -356,13 +356,14 @@ class RosterItem(object):
data = {'status': presence['status'], data = {'status': presence['status'],
'show': presence['show'], 'show': presence['show'],
'priority': presence['priority']} 'priority': presence['priority']}
if not self.resources: got_online = not self.resources
self.xmpp.event('got_online', presence)
if resource not in self.resources: if resource not in self.resources:
self.resources[resource] = {} self.resources[resource] = {}
old_status = self.resources[resource].get('status', '') old_status = self.resources[resource].get('status', '')
old_show = self.resources[resource].get('show', None) old_show = self.resources[resource].get('show', None)
self.resources[resource].update(data) self.resources[resource].update(data)
if got_online:
self.xmpp.event('got_online', presence)
if old_show != presence['show'] or old_status != presence['status']: if old_show != presence['show'] or old_status != presence['status']:
self.xmpp.event('changed_status', presence) self.xmpp.event('changed_status', presence)