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