From e5efd1a792773b694a7548edec704e2a240f77df Mon Sep 17 00:00:00 2001 From: Xavier Maillard Date: Sat, 27 Aug 2011 12:39:51 +0200 Subject: [PATCH] core: Fix status update crash bug: 4 --- src/core/xmpp.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/core/xmpp.py b/src/core/xmpp.py index 4b4538e0..86371c2d 100644 --- a/src/core/xmpp.py +++ b/src/core/xmpp.py @@ -224,11 +224,19 @@ class SatPresenceProtocol(xmppim.PresenceClientProtocol): 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)