diff src/core/xmpp.py @ 1170:2df6427a5299

plugin OTR: forces FINISHED state if we are in ENCRYPTED state on contact disconnection
author souliane <souliane@mailoo.org>
date Fri, 05 Sep 2014 11:16:38 +0200
parents fe102b4cf275
children 9355f48f979e
line wrap: on
line diff
--- a/src/core/xmpp.py	Fri Sep 05 11:01:14 2014 +0200
+++ b/src/core/xmpp.py	Fri Sep 05 11:16:38 2014 +0200
@@ -328,6 +328,10 @@
                                            int(priority), statuses,
                                            self.parent.profile)
 
+        # uncomment these two lines if you need the trigger
+        #if not self.host.trigger.point("presenceReceived", entity, "unavailable", 0, statuses, self.parent.profile):
+        #    return
+
         # now it's time to notify frontends
         self.host.bridge.presenceUpdate(entity.full(), show or "",
                                         int(priority), statuses,
@@ -344,6 +348,9 @@
             del statuses[None]
         self.host.memory.setPresenceStatus(entity, "unavailable", 0, statuses, self.parent.profile)
 
+        if not self.host.trigger.point("presenceReceived", entity, "unavailable", 0, statuses, self.parent.profile):
+            return
+
         # now it's time to notify frontends
         self.host.bridge.presenceUpdate(entity.full(), "unavailable", 0, statuses, self.parent.profile)