diff src/core/xmpp.py @ 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 8e0072754413
children 2df6427a5299
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)