Getting profile picture url
Hey people, I have a question, the way I've implemented to get the profile picture of someone who sent me a message was just creating a PictureIqProtocolEntity using his jid and sending it to lower, on the same custom layer I have a protocol callback iq to receive this iq result and then I save the picture data of this entity received. Is there another easier way to get the profile picture? Can I also get the url of a certain profile picture given its jid?
Thank you,
Lucas Meyer
profile picture is only received in node data by request.
So, the only way to get the profile picture was the way I've done below? I've put this callback on my custom layer:
@ProtocolEntityCallback('iq') def onIq(self, entity):
salvarComo = os.path.dirname(os.path.realpath(__file__)) + '/fdb/' + 'name-fdb.jpg'
rawFoto = entity.pictureData.encode('ISO-8859-1')
foto = open(salvarComo, 'wb')
foto.write(rawFoto)
foto.close()
Yup that is the only way.