# HG changeset patch # User Goffi # Date 1306190960 -7200 # Node ID 4c835d614bdbfaae0d732512b39446926f08d41b # Parent 8c9b9ef13ba1995dc4bb1feaa5903a50351eeed7 core: fixed a None sent instead of empty dict in unavailableReceived diff -r 8c9b9ef13ba1 -r 4c835d614bdb src/core/xmpp.py --- a/src/core/xmpp.py Tue May 24 00:48:29 2011 +0200 +++ b/src/core/xmpp.py Tue May 24 00:49:20 2011 +0200 @@ -24,6 +24,7 @@ from wokkel import client, disco, xmppim, generic, compat from logging import debug, info, error + class SatXMPPClient(client.XMPPClient): def __init__(self, host_app, profile, user_jid, password, host=None, port=5222): @@ -177,7 +178,9 @@ def unavailableReceived(self, entity, statuses=None): debug (_("presence update for [%(entity)s] (unavailable, statuses=%(statuses)s)") % {'entity':entity, 'statuses':statuses}) - if statuses and statuses.has_key(None): #we only want string keys + if not statuses: + statuses = {} + if statuses.has_key(None): #we only want string keys statuses["default"] = statuses[None] del statuses[None] self.host.memory.addPresenceStatus(entity, "unavailable", 0, statuses, self.parent.profile)