core: fixed a None sent instead of empty dict in unavailableReceived
This commit is contained in:
parent
ded007be26
commit
75f4211b95
1 changed files with 4 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ from twisted.words.protocols.jabber import jid, xmlstream
|
|||
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 @@ class SatPresenceProtocol(xmppim.PresenceClientProtocol):
|
|||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue