mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user