# HG changeset patch # User Xavier Maillard # Date 1314441591 -7200 # Node ID adcc41e4d6eadbe2987dff3638ba7e209f531e68 # Parent 3646f6b9adb664f829650d26e97bd9c9e7b1c69d core: Fix status update crash bug: 4 diff -r 3646f6b9adb6 -r adcc41e4d6ea src/core/xmpp.py --- 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)