diff src/core/xmpp.py @ 611:d722778b152c

core: added Priority management
author Goffi <goffi@goffi.org>
date Sun, 10 Mar 2013 20:55:29 +0100
parents 84a6e83157c2
children 7ea6d5a86e58
line wrap: on
line diff
--- a/src/core/xmpp.py	Sun Mar 10 20:54:45 2013 +0100
+++ b/src/core/xmpp.py	Sun Mar 10 20:55:29 2013 +0100
@@ -295,7 +295,13 @@
         # now it's time to notify frontends
         self.host.bridge.presenceUpdate(entity.full(), "unavailable", 0, statuses, self.parent.profile)
 
-    def available(self, entity=None, show=None, statuses=None, priority=0):
+    def available(self, entity=None, show=None, statuses=None, priority=None):
+        if priority is None:
+            try:
+                priority = int(self.host.memory.getParamA("Priority", "Connection", profile_key=self.parent.profile))
+            except ValueError:
+                priority = 0
+
         if not statuses:
             statuses = {}
             # default for us is None for wokkel