Home > borogove > Client

Client class

Signature:

export class Client extends borogove.EventEmitter 

Extends: borogove.EventEmitter

Constructors

Constructor Modifiers Description
(constructor)(accountId, persistence) Create a new Client to connect to a particular account

Properties

Property Modifiers Type Description
sendAvailable boolean Set to false to suppress sending available presence

Methods

Method Modifiers Description
accountId() Get the account ID for this Client
addCallMediaListener(handler) Event fired when a call is asking for media to send
addCallRetractListener(handler) Event fired when a call is retracted or hung up
addCallRingingListener(handler) Event fired when an outgoing call starts ringing
addCallRingListener(handler) Event fired when a new call comes in
addCallTrackListener(handler) Event fired when call has a new MediaStreamTrack to play
addCallUpdateStatusListener(handler) Event fired when an existing call changes status (connecting, failed, etc)
addChatMessageListener(handler) Event fired when a new ChatMessage comes in on any Chat Also fires when status of a ChatMessage changes, when a ChatMessage is edited, or when a reaction is added
addChatsUpdatedListener(handler) Event fired when a Chat's metadata is updated, or when a new Chat is added
addConnectionFailedListener(handler) Event fired when connection fails with a fatal error and will not be retried
addPasswordNeededListener(handler) Event fired when client needs a password for authentication
addStatusOfflineListener(handler) Event fired when client is disconnected
addStatusOnlineListener(handler) Event fired when client is connected and fully synchronized
addSyncMessageListener(handler) Event fired when syncing a new ChatMessage that was send when offline. Normally you don't want this, but it may be useful if you want to notify on app start.
addTlsCheckListener(handler) Event fired when TLS checks fail, to give client the chance to override
addUserStateListener(handler)
displayName() Get the current display name for this account
enablePush(push_service, endpoint, p256dh, auth, grace, vapid_private_pkcs8, claims) Enable push notifications
findAvailableChats(q, callback) Search for chats the user can start or join
getChat(chatId) Find a chat by id
getChats()
logout(completely) Destroy local data for this account
prepareAttachment(source) Turn a file into a ChatAttachment for attaching to a ChatMessage
setDisplayName(displayName) Set the current display name for this account on the server
setInForeground() Let the SDK know the UI is in the foreground
setNotInForeground() Let the SDK know the UI is in the foreground
start() Start this client running and trying to connect to the server
startChat(availableChat) Start or join a chat from the search results
startOffline() Gets the client ready to use but does not connect to the server
subscribePush(reg, push_service, vapid_key, grace)
usePassword(password) Sets the password to be used in response to the password needed event