diff src/core/sat_main.py @ 917:a9401694d2dc

bridge, frontends: display presence with the highest priority + reset your own presence when you (dis)connect
author souliane <souliane@mailoo.org>
date Thu, 20 Mar 2014 21:18:18 +0100
parents 1a759096ccbd
children ed9841e6d84a
line wrap: on
line diff
--- a/src/core/sat_main.py	Fri Mar 21 16:27:09 2014 +0100
+++ b/src/core/sat_main.py	Thu Mar 20 21:18:18 2014 +0100
@@ -574,15 +574,16 @@
                                        extra=mess_data['extra'],
                                        profile=profile)
 
-    def _setPresence(self, to="", show="", priority=0, statuses=None, profile_key=C.PROF_KEY_NONE):
-        return self.setPresence(jid.JID(to) if to else None, show, priority, statuses, profile_key)
+    def _setPresence(self, to="", show="", statuses=None, profile_key=C.PROF_KEY_NONE):
+        return self.setPresence(jid.JID(to) if to else None, show, statuses, profile_key)
 
-    def setPresence(self, to_jid=None, show="", priority=0, statuses=None, profile_key=C.PROF_KEY_NONE):
+    def setPresence(self, to_jid=None, show="", statuses=None, profile_key=C.PROF_KEY_NONE):
         """Send our presence information"""
         if statuses is None:
             statuses = {}
         profile = self.memory.getProfileName(profile_key)
         assert(profile)
+        priority = int(self.memory.getParamA("Priority", "Connection", profile_key=profile))
         self.profiles[profile].presence.available(to_jid, show, statuses, priority)
         #XXX: FIXME: temporary fix to work around openfire 3.7.0 bug (presence is not broadcasted to generating resource)
         if '' in statuses: