Mercurial > libervia-backend
comparison src/core/xmpp.py @ 1167:fe102b4cf275
core (xmpp): fixes SatPresenceProtocol.available to prevent an eventual code skipping
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 04 Sep 2014 11:26:22 +0200 |
parents | 8e0072754413 |
children | 2df6427a5299 |
comparison
equal
deleted
inserted
replaced
1166:6b15a6d184d5 | 1167:fe102b4cf275 |
---|---|
362 if 'default' in statuses: | 362 if 'default' in statuses: |
363 statuses[None] = statuses['default'] | 363 statuses[None] = statuses['default'] |
364 del statuses['default'] | 364 del statuses['default'] |
365 | 365 |
366 presence_elt = xmppim.AvailablePresence(entity, show, statuses, priority) | 366 presence_elt = xmppim.AvailablePresence(entity, show, statuses, priority) |
367 if not self.host.trigger.point("presence_available", presence_elt, self.parent): | |
368 return | |
369 self.send(presence_elt) | |
370 | 367 |
371 # ... before switching back | 368 # ... before switching back |
372 if None in statuses: | 369 if None in statuses: |
373 statuses['default'] = statuses[None] | 370 statuses['default'] = statuses[None] |
374 del statuses[None] | 371 del statuses[None] |
372 | |
373 if not self.host.trigger.point("presence_available", presence_elt, self.parent): | |
374 return | |
375 self.send(presence_elt) | |
375 | 376 |
376 def subscribed(self, entity): | 377 def subscribed(self, entity): |
377 xmppim.PresenceClientProtocol.subscribed(self, entity) | 378 xmppim.PresenceClientProtocol.subscribed(self, entity) |
378 self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile) | 379 self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile) |
379 item = self.parent.roster.getItem(entity) | 380 item = self.parent.roster.getItem(entity) |