Skip to content

Commit

Permalink
✨ feat: message.device & message.local #3242
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Sep 17, 2024
1 parent 90b4589 commit 60f5c89
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/api/model/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 60f5c89

Please sign in to comment.