Variables
Methods
addMedia(streams:Array<MediaStream>):Void
Add additional media streams to the active call in this chat.
Parameters:
streams | media streams to add to the current session |
|---|
addMembersUpdatedListener(handler:Array<Member> ‑> Void):EventHandlerToken
Event fired when a member is updated, or when a new member is added
Parameters:
handler | takes one argument, an array of Member that were updated |
|---|
Returns:
token for use with removeEventListener
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 |
addRole(member:Member, role:Role):Void
Add a role to a member
Parameters:
member | the member to update |
|---|---|
role | the role to add |
block(reportSpam:Bool = false, ?spamMessage:ChatMessage, onServer:Bool = true):Void
Block this chat so it will not re-open
correctMessage(correct:ChatMessage, message:ChatMessageBuilder):Void
Correct an already-send message by replacing it with a new one
Parameters:
correct | the ChatMessage to correct |
|---|---|
message | the new ChatMessageBuilder to replace it with |
getMemberDetails(memberIds:Array<String>):Promise<Array<Null<Member>>>
Get the details for some members in this Chat
Parameters:
memberIds | the IDs of the member to look up |
|---|
getMessagesAfter(after:Null<ChatMessage>):Promise<Array<ChatMessage>>
Fetch a page of messages after some point
Parameters:
after | ChatMessage to look after, or null to start at the beginning |
|---|
Returns:
Promise resolving to an array of ChatMessage that are found
getMessagesAround(around:ChatMessage):Promise<Array<ChatMessage>>
Fetch a page of messages around (before, including, and after) some point
Parameters:
around | ChatMessage to look around |
|---|
Returns:
Promise resolving to an array of ChatMessage that are found
getMessagesBefore(before:Null<ChatMessage>):Promise<Array<ChatMessage>>
Fetch a page of messages before some point
Parameters:
before | ChatMessage to look before, or null to start at the end |
|---|
Returns:
Promise resolving to an array of ChatMessage that are found
invite(other:Chat, ?threadId:String):Void
Invite another chat's participants to participate in this one
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 |
|---|
members():Promise<Array<Member>>
Get a list of members in this Chat
This list will often be a a complete list of everyone who has access to the chat, but for larger chats may be incomplete.
moderate(message:ChatMessage, reason:String):Void
Moderate a message by replacing it with a tombstone (if permitted)
Parameters:
message | the message to moderate |
|---|---|
reason | the reason for moderating this message |
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 |
removeRole(member:Member, role:Role):Void
Remove a role from a member
Parameters:
member | the member to update |
|---|---|
role | the role 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 |
|---|
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):Session
Start a new call in this Chat
Parameters:
audio | do we want audio in this call |
|---|---|
video | do we want video in this call |
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 |