Mercurial > libervia-backend
diff src/core/xmpp.py @ 333:4c835d614bdb
core: fixed a None sent instead of empty dict in unavailableReceived
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 24 May 2011 00:49:20 +0200 |
parents | 608a4a2ba94e |
children | 698cbc6ebec8 |
line wrap: on
line diff
--- 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)