core (xmpp): fixes SatPresenceProtocol.available to prevent an eventual code skipping

This commit is contained in:
souliane 2014-09-04 11:26:22 +02:00
commit b294272020

View file

@ -364,15 +364,16 @@ class SatPresenceProtocol(xmppim.PresenceClientProtocol):
del statuses['default']
presence_elt = xmppim.AvailablePresence(entity, show, statuses, priority)
if not self.host.trigger.point("presence_available", presence_elt, self.parent):
return
self.send(presence_elt)
# ... before switching back
if None in statuses:
statuses['default'] = statuses[None]
del statuses[None]
if not self.host.trigger.point("presence_available", presence_elt, self.parent):
return
self.send(presence_elt)
def subscribed(self, entity):
xmppim.PresenceClientProtocol.subscribed(self, entity)
self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile)