changeset 1167:fe102b4cf275

core (xmpp): fixes SatPresenceProtocol.available to prevent an eventual code skipping
author souliane <souliane@mailoo.org>
date Thu, 04 Sep 2014 11:26:22 +0200
parents 6b15a6d184d5
children 39572f9d5249
files src/core/xmpp.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/xmpp.py	Thu Sep 04 20:34:38 2014 +0200
+++ b/src/core/xmpp.py	Thu Sep 04 11:26:22 2014 +0200
@@ -364,15 +364,16 @@
             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)