feat: get contact's profile picture

This commit is contained in:
Pedro Lopez 2020-02-08 01:23:29 -04:00
commit f2b286a319

View file

@ -91,6 +91,18 @@ class Contact extends Base {
return super._patch(data);
}
/**
* Returns the contact's profile picture URL, if privacy settings allow it
* @returns {Promise<string>}
*/
async getProfilePicUrl() {
const profilePic = await this.client.pupPage.evaluate((contactId) => {
return window.Store.Wap.profilePicFind(contactId);
}, this.id._serialized);
return profilePic ? profilePic.eurl : undefined;
}
}