Mercurial > libervia-backend
changeset 560:7ffae708b176
plugin XEP-0054: added profile own jid to _fillCachedValues (needed to have its own avatar)
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 18 Dec 2012 00:02:28 +0100 |
parents | bdcd8c6c4ed4 |
children | 97f6a445d6e8 |
files | src/plugins/plugin_xep_0054.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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()