# HG changeset patch # User Goffi # Date 1306191189 -7200 # Node ID 698cbc6ebec8387c4618c528625422873cb1b1ca # Parent 4c835d614bdbfaae0d732512b39446926f08d41b core: fixed None instead of empty dict in availableReceived diff -r 4c835d614bdb -r 698cbc6ebec8 src/core/xmpp.py --- a/src/core/xmpp.py Tue May 24 00:49:20 2011 +0200 +++ b/src/core/xmpp.py Tue May 24 00:53:09 2011 +0200 @@ -165,6 +165,9 @@ def availableReceived(self, entity, show=None, statuses=None, priority=0): debug (_("presence update for [%(entity)s] (available, show=%(show)s statuses=%(statuses)s priority=%(priority)d)") % {'entity':entity, 'show':show, 'statuses':statuses, 'priority':priority}) + if not statuses: + statuses = {} + if statuses.has_key(None): #we only want string keys statuses["default"] = statuses[None] del statuses[None] @@ -178,8 +181,10 @@ def unavailableReceived(self, entity, statuses=None): debug (_("presence update for [%(entity)s] (unavailable, statuses=%(statuses)s)") % {'entity':entity, 'statuses':statuses}) + if not statuses: statuses = {} + if statuses.has_key(None): #we only want string keys statuses["default"] = statuses[None] del statuses[None]