Constructor

new(?params:{versions:Null<Array<ChatMessage>>, type:Null<MessageType>, timestamp:Null<String>, threadId:Null<String>, text:Null<String>, syncPoint:Null<Bool>, status:Null<MessageStatus>, serverIdBy:Null<String>, serverId:Null<String>, senderId:Null<String>, replyToMessage:Null<ChatMessage>, replyId:Null<String>, reactions:Null<Map<String, Array<Reaction>>>, payloads:Null<Array<Stanza>>, localId:Null<String>, lang:Null<String>, html:Null<String>, encryption:Null<EncryptionInfo>, direction:Null<MessageDirection>, attachments:Null<Array<ChatAttachment>>})

Returns:

a new blank ChatMessageBuilder

Variables

@:value([])read onlyattachments:Array<ChatAttachment> = []

Array of attachments to this message

@:value(MessageReceived)direction:MessageDirection = MessageReceived

Direction of this message

encryption:Null<EncryptionInfo>

Information about the encryption used by the sender of this message.

@:value(null)lang:Null<String> = null

Language code for the body text

@:value(null)localId:Null<String> = null

The ID as set by the creator of this message

@:value([])@HaxeCBridge.noemitreactions:Map<String, Array<Reaction>> = []

Map of reactions to this message

@:value(null)replyToMessage:Null<ChatMessage> = null

Message this one is in reply to, or NULL

@:value(null)senderId:Null<String> = null

The ID of the message sender

@:value(null)serverId:Null<String> = null

The ID as set by the authoritative server

@:value(null)serverIdBy:Null<String> = null

The ID of the server which set the serverId

@:value(MessagePending)status:MessageStatus = MessagePending

Status of this message

@:value(null)text:Null<String> = null

Body text of this message or NULL

@:value(null)threadId:Null<String> = null

ID of the thread this message is in, or NULL

@:value(null)timestamp:Null<String> = null

The timestamp of this message, in format YYYY-MM-DDThh:mm:ss[.sss]+00:00

@:value(MessageChat)type:MessageType = MessageChat

The type of this message (Chat, Call, etc)

@:value([])versions:Array<ChatMessage> = []

Array of past versions of this message, if it has been edited

Methods

addAttachment(attachment:ChatAttachment):Void

Add an attachment to this message

Parameters:

attachment

The ChatAttachment to add

build():ChatMessage

Build this builder into an immutable ChatMessage

Returns:

the ChatMessage

chatId():String

The ID of the Chat this message is associated with

get_senderId():String

The ID of the sender of this message

setHtml(html:String):Void

Set rich text using an HTML string Also sets the plain text body appropriately