feat: Add from which device the message was sent (#648)
* Add from which device the message was sent. Use the message Id for fingerprint the device that was being use when the message was sent * To single quotes Co-authored-by: Pedro S. Lopez <pslamoros@hotmail.com>
This commit is contained in:
parent
63d11d3f84
commit
0a061f982c
1 changed files with 6 additions and 0 deletions
|
|
@ -82,6 +82,12 @@ class Message extends Base {
|
|||
*/
|
||||
this.author = (typeof (data.author) === 'object' && data.author !== null) ? data.author._serialized : data.author;
|
||||
|
||||
/**
|
||||
* String that represents from which device type the message was sent
|
||||
* @type {string}
|
||||
*/
|
||||
this.deviceType = data.id.id.length > 21 ? 'android' : data.id.id.substring(0,2) =='3A' ? 'ios' : 'web';
|
||||
|
||||
/**
|
||||
* Indicates if the message was forwarded
|
||||
* @type {boolean}
|
||||
|
|
|
|||
Loading…
Reference in a new issue