expose some more fields on contacts

This commit is contained in:
Pedro Lopez
2020-02-08 01:12:25 -04:00
parent 2896aeb382
commit 004312a99f
2 changed files with 36 additions and 0 deletions

View File

@@ -59,6 +59,36 @@ class Contact extends Base {
this.verifiedLevel = data.verifiedLevel;
this.verifiedName = data.verifiedName;
/**
* Indicates if the contact is the current user's contact
* @type {boolean}
*/
this.isMe = data.isMe;
/**
* Indicates if the contact is a user contact
* @type {boolean}
*/
this.isUser = data.isUser;
/**
* Indicates if the contact is a group contact
* @type {boolean}
*/
this.isGroup = data.isGroup;
/**
* Indicates if the number is registered on WhatsApp
* @type {boolean}
*/
this.isWAContact = data.isWAContact;
/**
* Indicates if the number is saved in the current phone's contacts
* @type {boolean}
*/
this.isMyContact = data.isMyContact;
return super._patch(data);
}

View File

@@ -140,6 +140,12 @@ exports.LoadUtils = () => {
res.businessProfile = contact.businessProfile.serialize();
}
res.isMe = contact.isMe;
res.isUser = contact.isUser;
res.isGroup = contact.isGroup;
res.isWAContact = contact.isWAContact;
res.isMyContact = contact.isMyContact;
return res;
};