diff browser_side/contact.py @ 304:2ab513a47e3b

browser_side: fix presence/status update (do not share between different resources)
author souliane <souliane@mailoo.org>
date Wed, 18 Dec 2013 09:54:27 +0100
parents 3216c8d5432b
children 05e264e96a1c
line wrap: on
line diff
--- a/browser_side/contact.py	Wed Dec 18 09:51:10 2013 +0100
+++ b/browser_side/contact.py	Wed Dec 18 09:54:27 2013 +0100
@@ -293,13 +293,13 @@
         @param jid: JID userhost as unicode
         """
         if availability == 'unavailable':
-            if self.connected.has_key(jid):
-                if self.connected[jid].has_key(resource):
+            if jid in self.connected:
+                if resource in self.connected[jid]:
                     del self.connected[jid][resource]
                 if not self.connected[jid]:
                     del self.connected[jid]
         else:
-            if not self.connected.has_key(jid):
+            if not jid in self.connected:
                 self.connected[jid] = {}
             self.connected[jid][resource] = (availability, priority, statuses)
         self._contact_list.setState(jid, "availability", availability)