comparison src/core/xmpp.py @ 562:0bb2e0d1c878

core, plugin XEP-0054: avatar upload: - plugin XEP-0054: new setAvatar bridge method - new "presence_available" trigger - new DataError
author Goffi <goffi@goffi.org>
date Fri, 28 Dec 2012 01:00:31 +0100
parents 2c5ef983f2ef
children 01569aa4d7aa
comparison
equal deleted inserted replaced
561:97f6a445d6e8 562:0bb2e0d1c878
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 298
299 def available(self, entity=None, show=None, statuses=None, priority=0): 299 def available(self, entity=None, show=None, statuses=None, priority=0):
300 if not statuses: 300 if not statuses:
301 statuses = {} 301 statuses = {}
302 # default for us is None for wokkel 302 # default for us is None for wokkel
303 # so we must temporarily switch to wokkel's convention... 303 # so we must temporarily switch to wokkel's convention...
304 if 'default' in statuses: 304 if 'default' in statuses:
305 statuses[None] = statuses['default'] 305 statuses[None] = statuses['default']
306 306
307 xmppim.PresenceClientProtocol.available(self, entity, show, statuses, priority) 307 xmppim.PresenceClientProtocol.available(self, entity, show, statuses, priority)
308 308 presence_elt = xmppim.AvailablePresence(entity, show, statuses, priority)
309 # ... before switching back 309 if not self.host.trigger.point("presence_available", presence_elt, self.parent):
310 if None in statuses: 310 return
311 del statuses[None] 311 self.send(presence_elt)
312
313 # ... before switching back
314 if None in statuses:
315 del statuses[None]
312 316
313 def subscribed(self, entity): 317 def subscribed(self, entity):
314 xmppim.PresenceClientProtocol.subscribed(self, entity) 318 xmppim.PresenceClientProtocol.subscribed(self, entity)
315 self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile) 319 self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile)
316 item = self.parent.roster.getItem(entity) 320 item = self.parent.roster.getItem(entity)