comparison src/plugins/plugin_xep_0054.py @ 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
parents d44360763262
children 528e5fafc11b
comparison
equal deleted inserted replaced
2063:8fa0d95c2142 2064:ee9621d92cb9
281 """Ask server for VCard 281 """Ask server for VCard
282 282
283 @param target(jid.JID): jid from which we want the VCard 283 @param target(jid.JID): jid from which we want the VCard
284 @result: id to retrieve the profile 284 @result: id to retrieve the profile
285 """ 285 """
286 to_jid = target.userhostJID() 286 target_bare = target.userhostJID()
287 to_jid = target if self.isRoom(client, target_bare) else target_bare
287 log.debug(_(u"Asking for %s's VCard") % to_jid.userhost()) 288 log.debug(_(u"Asking for %s's VCard") % to_jid.userhost())
288 reg_request = client.IQ('get') 289 reg_request = client.IQ('get')
289 reg_request["from"] = client.jid.full() 290 reg_request["from"] = client.jid.full()
290 reg_request["to"] = to_jid.userhost() 291 reg_request["to"] = to_jid.full()
291 reg_request.addElement('vCard', NS_VCARD) 292 reg_request.addElement('vCard', NS_VCARD)
292 reg_request.send(to_jid.userhost()).addCallbacks(self._getCardCb, self._getCardEb, callbackArgs=[to_jid, client], errbackArgs=[to_jid, client]) 293 reg_request.send(to_jid.full()).addCallbacks(self._getCardCb, self._getCardEb, callbackArgs=[to_jid, client], errbackArgs=[to_jid, client])
293 return reg_request["id"] 294 return reg_request["id"]
294 295
295 def getAvatarFile(self, avatar_hash): 296 def getAvatarFile(self, avatar_hash):
296 """Give the full path of avatar from hash 297 """Give the full path of avatar from hash
297 @param hash: SHA1 hash 298 @param hash: SHA1 hash