Skip to content

Commit 60f5c89

Browse files
committed
✨ feat: message.device & message.local #3242
1 parent 90b4589 commit 60f5c89

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/api/model/message.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ export interface Message {
3232
* 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.
3333
*/
3434
body: string;
35+
/**
36+
* 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.
37+
*
38+
* 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).
39+
*
40+
* If the device ID is `0` then the message was sent from the "root" host account device.
41+
*
42+
* This might be undefined for incoming messages.
43+
*/
44+
device: number;
45+
/**
46+
* 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.
47+
*/
48+
local: boolean;
3549
/**
3650
* a convenient way to get the main text content from a message.
3751
*/

0 commit comments

Comments
 (0)