changeset 2064:ee9621d92cb9

plugin XEP-0054: fix use of full jid for room occupants
author Goffi <goffi@goffi.org>
date Fri, 09 Sep 2016 23:54:33 +0200 (2016-09-09)
parents 8fa0d95c2142
children f3167c873e7b
files src/plugins/plugin_xep_0054.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0054.py	Fri Sep 09 23:54:33 2016 +0200
+++ b/src/plugins/plugin_xep_0054.py	Fri Sep 09 23:54:33 2016 +0200
@@ -283,13 +283,14 @@
         @param target(jid.JID): jid from which we want the VCard
         @result: id to retrieve the profile
         """
-        to_jid = target.userhostJID()
+        target_bare = target.userhostJID()
+        to_jid = target if self.isRoom(client, target_bare) else target_bare
         log.debug(_(u"Asking for %s's VCard") % to_jid.userhost())
         reg_request = client.IQ('get')
         reg_request["from"] = client.jid.full()
-        reg_request["to"] = to_jid.userhost()
+        reg_request["to"] = to_jid.full()
         reg_request.addElement('vCard', NS_VCARD)
-        reg_request.send(to_jid.userhost()).addCallbacks(self._getCardCb, self._getCardEb, callbackArgs=[to_jid, client], errbackArgs=[to_jid, client])
+        reg_request.send(to_jid.full()).addCallbacks(self._getCardCb, self._getCardEb, callbackArgs=[to_jid, client], errbackArgs=[to_jid, client])
         return reg_request["id"]
 
     def getAvatarFile(self, avatar_hash):