Home > borogove > ChatMessage

ChatMessage class

Signature:

export class ChatMessage 

Constructors

Constructor Modifiers Description
(constructor)(params) protected Constructs a new instance of the ChatMessage class

Properties

Property Modifiers Type Description
attachments borogove.ChatAttachment[] Array of attachments to this message
direction enums.MessageDirection Direction of this message
encryption borogove.EncryptionInfo | null Information about the encryption used by the sender of this message.
lang string | null Language code for the body text
localId string | null The ID as set by the creator of this message
reactions readonly Map<string,borogove.Reaction[]> Map of reactions to this message
replyToMessage readonly borogove.ChatMessage | null Message this one is in reply to, or NULL
senderId string The ID of the sender of this message
serverId string | null The ID as set by the authoritative server
serverIdBy string | null The ID of the server which set the serverId
status enums.MessageStatus Status of this message
text string | null Body text of this message or NULL
threadId string | null ID of the thread this message is in, or NULL
timestamp string The timestamp of this message, in format YYYY-MM-DDThh:mm:ss[.sss]Z
type enums.MessageType The type of this message (Chat, Call, etc)
versions borogove.ChatMessage[] Array of past versions of this message, if it has been edited

Methods

Method Modifiers Description
account() The ID of the account associated with this message
callDuration() The duration of the call if this message is related to a call
callSid() The session id of the call if this message is related to a call
callStatus() The last status of the call if this message is related to a call
chatId() The ID of the Chat this message is associated with
html(sender) Get HTML version of the message body WARNING: this is possibly untrusted HTML. You must parse or sanitize appropriately!
isIncoming() Is this an incoming message?
reply() Create a new ChatMessage in reply to this one
threadIcon() The URI of an icon for the thread associated with this message, or NULL