Home > borogove > Chat

Chat class

Signature:

export class borogove_Chat extends borogove_EventEmitter 

Extends: borogove_EventEmitter

Constructors

Constructor Modifiers Description
(constructor)(client, stream, persistence, chatId, uiState, isBookmarked, isBlocked, extensions, readUpToId, readUpToBy, omemoContactDeviceIDs) protected Constructs a new instance of the borogove_Chat class

Properties

Property Modifiers Type Description
chatId readonly string ID of this Chat
isBlocked readonly boolean Is this chat blocked?
isBookmarked readonly boolean Has this chat ever been bookmarked?
lastMessage readonly borogove_ChatMessage | null The most recent message in this chat
status readonly borogove_Status
uiState readonly borogove_UiState Current state of this chat

Methods

Method Modifiers Description
acceptCall() Accept any incoming calls in this Chat
addMedia(streams) Add additional media streams to the active call in this chat.
addMembersUpdatedListener(handler) Event fired when a member is updated, or when a new member is added
addReaction(m, reaction) Add new reaction to a message in this Chat
addRole(member, role) Add a role to a member
availableRoles(member) Roles the current user can assign to the target member
block(reportSpam, spamMessage, onServer) Block this chat so it will not re-open
bookmark() Save this Chat on the server
callStatus() The current status of a call in this chat
canAudioCall() Can audio calls be started in this Chat?
canInvite() Can the user invite others to this chat?
canModerate() Can the user send messages to this chat?
canRemoveRole(member, role) Can the current user remove this role from the member?
canSend() Can the user send messages to this chat?
canVideoCall() Can video calls be started in this Chat?
close() Archive this chat
commands() List commands exposed by this chat
correctMessage(correct, message) Correct an already-send message by replacing it with a new one
dtmf() A DTMFSender for a call in this chat, or NULL
encryptionMode() Get encryption mode for this chat
getDisplayName() The display name of this Chat
getMemberDetails(memberIds) Get the details for some members in this Chat
getMessagesAfter(after) Fetch a page of messages after some point
getMessagesAround(around) Fetch a page of messages around (before, including, and after) some point
getMessagesBefore(before) Fetch a page of messages before some point
getPhoto() Get the URI image to represent this Chat, or null
getPlaceholder() Get the URI to a placeholder image to represent this Chat
getTags() Tags on this Chat
hangup() Hangup or reject any calls in this chat
hasCommands() Does this chat provide a menu of commands?
invite(other, threadId) Invite another chat's participants to participate in this one
invitedBy() The Member that originally invited us to this Chat, if we were invited
isApp() This chat's primary mode of interaction is via commands
isTrusted() Is this a chat with an entity we trust to see our online status?
markReadUpTo(message) Signals that all messages up to and including this one have probably been displayed to the user
members() 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, reason) Moderate a message by replacing it with a tombstone (if permitted)
notificationsFiltered() Should notifications be filtered?
notifyMention() Should a mention produce a notification?
notifyReply() Should a reply produce a notification?
preview() A preview of the chat, such as the most recent message body
readUpTo() An ID of the last message displayed to the user
removeReaction(m, reaction) Remove an already-sent reaction from a message
removeRole(member, role) Remove a role from a member
sendMessage(message) Send a message to this Chat
setActive(active, threadId) 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
setDisplayName(displayName) Set the display name to use for this chat
setNotifications(filtered, mention, reply) Update notification preferences
setTrusted(trusted) Set if this chat is to be trusted with our presence, etc
startCall(audio, video) Start a new call in this Chat
syncing()
togglePinned() Pin or unpin this chat
typing(threadId, content) Call this whenever the user is typing, can call on every keystroke
unblock(onServer) Unblock this chat so it will open again
unreadCount() The number of message that have not yet been displayed to the user
videoTracks() All video tracks in all active calls in this chat