plugin XEP-0054: fix use of full jid for room occupants

This commit is contained in:
Goffi 2016-09-09 23:54:33 +02:00
commit 4f26367e7a

View file

@ -283,13 +283,14 @@ class XEP_0054(object):
@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):