# HG changeset patch # User Goffi # Date 1355785348 -3600 # Node ID 7ffae708b176b07af1c5b9dc4661bf87d0aaeb23 # Parent bdcd8c6c4ed4394043a485f8b93e9ea0db3abed7 plugin XEP-0054: added profile own jid to _fillCachedValues (needed to have its own avatar) diff -r bdcd8c6c4ed4 -r 7ffae708b176 src/plugins/plugin_xep_0054.py --- a/src/plugins/plugin_xep_0054.py Sun Dec 16 18:02:43 2012 +0100 +++ b/src/plugins/plugin_xep_0054.py Tue Dec 18 00:02:28 2012 +0100 @@ -85,7 +85,7 @@ # 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(): + 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) @@ -185,16 +185,16 @@ error (_("Can't find VCard of %s") % failure.value.stanza['from']) self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile) #FIXME: maybe an error message would be better - def getCard(self, target, profile_key='@DEFAULT@'): + def getCard(self, target_s, profile_key='@DEFAULT@'): """Ask server for VCard - @param target: jid from which we want the VCard + @param target_s: jid from which we want the VCard @result: id to retrieve the profile""" current_jid, xmlstream = self.host.getJidNStream(profile_key) if not xmlstream: error (_('Asking vcard for an non-existant or not connected profile')) return "" profile = self.host.memory.getProfileName(profile_key) - to_jid = jid.JID(target) + to_jid = jid.JID(target_s) debug(_("Asking for %s's VCard") % to_jid.userhost()) reg_request=IQ(xmlstream,'get') reg_request["from"]=current_jid.full()