changeset 334:698cbc6ebec8

core: fixed None instead of empty dict in availableReceived
author Goffi <goffi@goffi.org>
date Tue, 24 May 2011 00:53:09 +0200
parents 4c835d614bdb
children 99206631503e
files src/core/xmpp.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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]