comparison 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
comparison
equal deleted inserted replaced
610:c8c07c920e30 611:d722778b152c
293 self.host.memory.setPresenceStatus(entity, "unavailable", 0, statuses, self.parent.profile) 293 self.host.memory.setPresenceStatus(entity, "unavailable", 0, statuses, self.parent.profile)
294 294
295 # now it's time to notify frontends 295 # now it's time to notify frontends
296 self.host.bridge.presenceUpdate(entity.full(), "unavailable", 0, statuses, self.parent.profile) 296 self.host.bridge.presenceUpdate(entity.full(), "unavailable", 0, statuses, self.parent.profile)
297 297
298 def available(self, entity=None, show=None, statuses=None, priority=0): 298 def available(self, entity=None, show=None, statuses=None, priority=None):
299 if priority is None:
300 try:
301 priority = int(self.host.memory.getParamA("Priority", "Connection", profile_key=self.parent.profile))
302 except ValueError:
303 priority = 0
304
299 if not statuses: 305 if not statuses:
300 statuses = {} 306 statuses = {}
301 # default for us is None for wokkel 307 # default for us is None for wokkel
302 # so we must temporarily switch to wokkel's convention... 308 # so we must temporarily switch to wokkel's convention...
303 if 'default' in statuses: 309 if 'default' in statuses: