Variables

read onlychatId:String

ID of this Chat

@:value(false)read onlyisBlocked:Bool = false

Is this chat blocked?

read onlylastMessage:Null<ChatMessage>

The most recent message in this chat

@:value(Open)@:allow(borogove)read onlyuiState:UiState = Open

Current state of this chat

Methods

acceptCall():Void

Accept any incoming calls in this Chat

@HaxeCBridge.noemitaddMedia(streams:Array<MediaStream>):Void

addReaction(m:ChatMessage, reaction:Reaction):Void

Add new reaction to a message in this Chat

Parameters:

m

ChatMessage to react to

reaction

emoji of the reaction

@:value({ onServer : true, reportSpam : null })block(?reportSpam:ChatMessage, onServer:Bool = true):Void

Block this chat so it will not re-open

bookmark():Void

Save this Chat on the server

callStatus():CallStatus

The current status of a call in this chat

canAudioCall():Bool

Can audio calls be started in this Chat?

canVideoCall():Bool

Can video calls be started in this Chat?

close():Void

Archive this chat

correctMessage(localId:String, message:ChatMessageBuilder):Void

Correct an already-send message by replacing it with a new one

Parameters:

localId

the localId of the message to correct must be the localId of the first version ever sent, not a subsequent correction

message

the new ChatMessage to replace it with

dtmf():Null<DTMFSender>

A DTMFSender for a call in this chat, or NULL

encryptionMode():String

Get encryption mode for this chat

getDisplayName():String

The display name of this Chat

getMessagesAfter(afterId:Null<String>, afterTime:Null<String>):Promise<Array<ChatMessage>>

Fetch a page of messages after some point

Parameters:

afterId

id of the message to look after

afterTime

timestamp of the message to look after, String in format YYYY-MM-DDThh:mm:ss[.sss]+00:00

Returns:

Promise resolving to an array of ChatMessage that are found

getMessagesAround(aroundId:Null<String>, aroundTime:Null<String>):Promise<Array<ChatMessage>>

Fetch a page of messages around (before, including, and after) some point

Parameters:

aroundId

id of the message to look around

aroundTime

timestamp of the message to look around, String in format YYYY-MM-DDThh:mm:ss[.sss]+00:00

Returns:

Promise resolving to an array of ChatMessage that are found

getMessagesBefore(beforeId:Null<String>, beforeTime:Null<String>):Promise<Array<ChatMessage>>

Fetch a page of messages before some point

Parameters:

beforeId

id of the message to look before

beforeTime

timestamp of the message to look before, String in format YYYY-MM-DDThh:mm:ss[.sss]+00:00

Returns:

Promise resolving to an array of ChatMessage that are found

getParticipantDetails(participantId:String):Participant

Get the details for one participant in this Chat

Parameters:

participantId

the ID of the participant to look up

getParticipants():Array<String>

Get the list of IDs of participants in this Chat

Returns:

array of IDs

getPhoto():Null<String>

Get the URI image to represent this Chat, or null

getPlaceholder():String

Get the URI to a placeholder image to represent this Chat

hangup():Void

Hangup or reject any calls in this chat

isTrusted():Bool

Is this a chat with an entity we trust to see our online status?

lastMessageId():Null<String>

An ID of the most recent message in this chat

markReadUpTo(message:ChatMessage):Void

Signals that all messages up to and including this one have probably been displayed to the user

Parameters:

message

the ChatMessage most recently displayed

notificationsFiltered():Bool

Should notifications be filtered?

notifyMention():Bool

Should a mention produce a notification?

notifyReply():Bool

Should a reply produce a notification?

preview():String

A preview of the chat, such as the most recent message body

readUpTo():Null<String>

An ID of the last message displayed to the user

removeReaction(m:ChatMessage, reaction:Reaction):Void

Remove an already-sent reaction from a message

Parameters:

m

ChatMessage to remove the reaction from

reaction

the emoji to remove

sendMessage(message:ChatMessageBuilder):Void

Send a message to this Chat

Parameters:

message

the ChatMessageBuilder to send

setActive(active:Bool, threadId:Null<String>):Void

Call this whenever the user makes a chat or thread "active" in your UX If you call this with true you MUST later call it will false

Parameters:

active

true if the chat is "active", false otherwise

threadId

optional, what thread the user has selected if any

setDisplayName(displayName:String):Void

Set the display name to use for this chat

Parameters:

displayName

String to use as display name

setNotifications(filtered:Bool, mention:Bool, reply:Bool):Void

Update notification preferences

setTrusted(trusted:Bool):Void

Set if this chat is to be trusted with our presence, etc

Parameters:

trusted

Bool if trusted or not

startCall(audio:Bool, video:Bool):OutgoingProposedSession

Start a new call in this Chat

Parameters:

audio

do we want audio in this call

video

do we want video in this call

syncing():Bool

Returns:

if this chat is currently syncing with the server

togglePinned():Void

Pin or unpin this chat

typing(threadId:Null<String>, content:Null<String>):Void

Call this whenever the user is typing, can call on every keystroke

Parameters:

threadId

optional, what thread the user has selected if any

content

optional, what the user has typed so far

unblock(onServer:Bool):Void

Unblock this chat so it will open again

unreadCount():Int

The number of message that have not yet been displayed to the user

videoTracks():Array<MediaStreamTrack>

All video tracks in all active calls in this chat