feat: add received vcards to the message.
This commit is contained in:
parent
b15ec768d3
commit
75296b652b
1 changed files with 7 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ class Message extends Base {
|
|||
* Message content
|
||||
* @type {string}
|
||||
*/
|
||||
this.body = data.type === MessageTypes.CONTACT_CARD_MULTI ? data.vcardList.map((c) => c.vcard) : this.hasMedia ? data.caption || '' : data.body || '';
|
||||
this.body = this.hasMedia ? data.caption || '' : data.body || '';
|
||||
|
||||
/**
|
||||
* Message type
|
||||
|
|
@ -117,6 +117,12 @@ class Message extends Base {
|
|||
*/
|
||||
this.location = data.type === MessageTypes.LOCATION ? new Location(data.lat, data.lng, data.loc) : undefined;
|
||||
|
||||
/**
|
||||
* List of vcards contained in the message, if the message is a vcard or multiple vcards.
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.vcards = data.type === MessageTypes.CONTACT_CARD_MULTI ? data.vcardList.map((c) => c.vcard) : data.type === MessageTypes.CONTACT_CARD ? [data.body] : [];
|
||||
|
||||
/**
|
||||
* Indicates the mentions in the message body.
|
||||
* @type {Array<string>}
|
||||
|
|
|
|||
Loading…
Reference in a new issue