Mercurial > libervia-backend
changeset 379:adcc41e4d6ea
core: Fix status update crash
bug: 4
author | Xavier Maillard <xavier@maillard.im> |
---|---|
date | Sat, 27 Aug 2011 12:39:51 +0200 |
parents | 3646f6b9adb6 |
children | ede26abf6ca1 |
files | src/core/xmpp.py |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/xmpp.py Sun Aug 14 18:06:14 2011 +0200 +++ b/src/core/xmpp.py Sat Aug 27 12:39:51 2011 +0200 @@ -224,11 +224,19 @@ def available(self, entity=None, show=None, statuses=None, priority=0): - if statuses and statuses.has_key('default'): + if not statuses: + statuses = {} + # default for us is None for wokkel + # so we must temporarily switch to wokkel's convention... + if 'default' in statuses: statuses[None] = statuses['default'] - del statuses['default'] + xmppim.PresenceClientProtocol.available(self, entity, show, statuses, priority) - + + # ... before switching back + if None in statuses: + del statuses[None] + def subscribed(self, entity): xmppim.PresenceClientProtocol.subscribed(self, entity) self.host.memory.delWaitingSub(entity.userhost(), self.parent.profile)