diff src/plugins/plugin_xep_0054.py @ 1262:f8a8434dbac7 frontends_multi_profiles

core: improved roster management + misc: - updated methods to no use anymore methods deprecated in Wokkel - use of full jid when it make sense instead of bare jid - getContacts, updateContact and delContact are now asynchronous
author Goffi <goffi@goffi.org>
date Wed, 10 Dec 2014 18:32:33 +0100
parents 38fb8823cee8
children faa1129559b8
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0054.py	Mon Nov 24 17:20:51 2014 +0100
+++ b/src/plugins/plugin_xep_0054.py	Wed Dec 10 18:32:33 2014 +0100
@@ -102,9 +102,9 @@
         #       the current naive approach keeps a map between all jids of all profiles
         #       in persistent cache, and check if cached jid are in roster, then put avatar
         #       hashs in memory.
-        for _jid in client.roster.getBareJids() + [client.jid.userhost()]:
-            if _jid in self.avatars_cache:
-                self.host.memory.updateEntityData(jid.JID(_jid), "avatar", self.avatars_cache[_jid], client.profile)
+        for _jid in client.roster.getJids() + [client.jid]:
+            if _jid.userhost() in self.avatars_cache:
+                self.host.memory.updateEntityData(_jid, "avatar", self.avatars_cache[_jid.userhost()], client.profile)
 
     def profileConnected(self, profile):
         client = self.host.getClient(profile)