comparison src/core/xmpp.py @ 947:61c4755f0394

core (XMPP): fix status in presence
author Goffi <goffi@goffi.org>
date Fri, 28 Mar 2014 19:19:11 +0100
parents e1842ebcb2f3
children 4a577b170809
comparison
equal deleted inserted replaced
946:fe181994246a 947:61c4755f0394
335 335
336 # default for us is None for wokkel 336 # default for us is None for wokkel
337 # so we must temporarily switch to wokkel's convention... 337 # so we must temporarily switch to wokkel's convention...
338 if 'default' in statuses: 338 if 'default' in statuses:
339 statuses[None] = statuses['default'] 339 statuses[None] = statuses['default']
340 del statuses['default']
340 341
341 presence_elt = xmppim.AvailablePresence(entity, show, statuses, priority) 342 presence_elt = xmppim.AvailablePresence(entity, show, statuses, priority)
342 if not self.host.trigger.point("presence_available", presence_elt, self.parent): 343 if not self.host.trigger.point("presence_available", presence_elt, self.parent):
343 return 344 return
344 self.send(presence_elt) 345 self.send(presence_elt)
345 346
346 # ... before switching back 347 # ... before switching back
347 if None in statuses: 348 if None in statuses:
349 statuses['default'] = statuses[None]
348 del statuses[None] 350 del statuses[None]
349 351
350 def subscribed(self, entity): 352 def subscribed(self, entity):
351 xmppim.PresenceClientProtocol.subscribed(self, entity) 353 xmppim.PresenceClientProtocol.subscribed(self, entity)
352 self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile) 354 self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile)