From 60f5c89e8455f8276cfc86b1ce966e945eb002dd Mon Sep 17 00:00:00 2001 From: M SHAH Date: Tue, 17 Sep 2024 03:08:11 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20`message.device`=20&=20`mes?= =?UTF-8?q?sage.local`=20#3242?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/message.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/api/model/message.ts b/src/api/model/message.ts index 3c0b4077c3..25baaa6f8b 100644 --- a/src/api/model/message.ts +++ b/src/api/model/message.ts @@ -32,6 +32,20 @@ export interface Message { * The body of the message. If the message type is `chat` , `body` will be the text of the chat. If the message type is some sort of media, then this body will be the thumbnail of the media. */ body: string; + /** + * The device ID of the device that sent the message. This is only present if the message was sent from host account-linked session. This is useful for determining if a message was sent from a different mobile device (note that whenever a device) or a desktop session. + * + * Note: This will emit a number for the current controlled session also but the only way to know if the number represents the current session is by checking `local` (it will be `true` if the message was sent from the current session). + * + * If the device ID is `0` then the message was sent from the "root" host account device. + * + * This might be undefined for incoming messages. + */ + device: number; + /** + * If the message was sent from this controlled session this will be `true`. This is useful for determining if a message was sent from a different mobile device (note that whenever a device) or a desktop session. + */ + local: boolean; /** * a convenient way to get the main text content from a message. */