Allow the user to request their own profile image
This commit is contained in:
parent
1446e82dc0
commit
5fb84bca4f
|
@ -730,11 +730,16 @@ class Session(YowsupApp):
|
|||
self.logger.debug('Image hash is %s', image_hash)
|
||||
if ID != None:
|
||||
self.backend.handleVCard(self.user, ID, buddy, "", "", response.pictureData)
|
||||
if not (buddy == self.user or buddy == self.user.split('@')[0]):
|
||||
obuddy = self.buddies[buddy]
|
||||
self.updateBuddy(buddy, obuddy.nick, obuddy.groups, image_hash)
|
||||
|
||||
self.logger.debug('Requesting profile picture of %s', buddy)
|
||||
self.requestProfilePicture(buddy, onSuccess = onSuccess)
|
||||
if buddy == self.user or buddy == self.user.split('@')[0]:
|
||||
newbuddy = self.legacyName
|
||||
else:
|
||||
newbuddy = buddy
|
||||
self.logger.debug('Requesting profile picture of %s', newbuddy)
|
||||
self.requestProfilePicture(newbuddy, onSuccess = onSuccess)
|
||||
|
||||
def onDlsuccess(self, path):
|
||||
self.logger.info("Success: Image downloaded to %s", path)
|
||||
|
|
Loading…
Reference in a new issue