feat: Get corresponding Chat from Contact object and vice versa
close #269
This commit is contained in:
parent
34aa136bf9
commit
7180beda2e
3 changed files with 26 additions and 0 deletions
|
|
@ -105,6 +105,17 @@ class Contact extends Base {
|
|||
async getProfilePicUrl() {
|
||||
return await this.client.getProfilePicUrl(this.id._serialized);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Chat that corresponds to this Contact.
|
||||
* Will return null when getting chat for currently logged in user.
|
||||
* @returns {Promise<Chat>}
|
||||
*/
|
||||
async getChat() {
|
||||
if(this.isMe) return null;
|
||||
|
||||
return await this.client.getChatById(this.id._serialized);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue