ChatManager
Provides access to methods for using chat. A Chat manager object is obtained by calling the Session#getChatManager method.
Events
chats
- Emitted every time the chat list changes.conferenceChats
- Emitted every time the conference chats list changes.file
- Emitted every time a new chat message containing a file is received.message
- Emitted every time a new chat message is received.messageDisplayed
- Emitted every time messages are marked as displayed by this user.supportChat
- Emitted every time a support chat is received.
Example:
const chatManager = await session.getChatManager();
const chats = chatManager.getChats();
const chat = chatManager.getIndividualChat('alice@quobis');
Member Summary
Public Members | ||
public |
emitter: EventEmitter |
|
public |
supportChats: * |
Method Summary
Public Methods | ||
public |
async createChat(name: string, subject: string): Promise<Chat> Creates a new group chat. |
|
public |
async createSupportChat(context: object): Promise<Chat> Creates a support chat, which is a group chat where a agent is added in the moment of the creation. |
|
public |
Disables push notifications. |
|
public |
Enables push notifications. |
|
public |
Returns a list with all the chats except the associated with conference rooms. |
|
public |
Returns a list with chats associated to conference rooms. |
|
public |
getGroupChat(id: String): Chat Obtains the specified group chat. |
|
public |
getIndividualChat(participant: string): Chat Obtains an individual chat with the specified user. |
|
public |
setPushConfig(config: Object) Sets the Push Notifications service type and token. |
|
public |
async sync() Synchronizes latest chat messages from the sever and reorders the chat list. |
Public Methods
public async createChat(name: string, subject: string): Promise<Chat> source
Creates a new group chat.
public async createSupportChat(context: object): Promise<Chat> source
Creates a support chat, which is a group chat where a agent is added in the moment of the creation.
Params:
Name | Type | Attribute | Description |
context | object | Context of supportChat |
public getChats(): ImmutableList<Chat> source
Returns a list with all the chats except the associated with conference rooms.
public getConferenceChats(): ImmutableList<Chat> source
Returns a list with chats associated to conference rooms.
public getGroupChat(id: String): Chat source
Obtains the specified group chat.
Params:
Name | Type | Attribute | Description |
id | String | Address of the group chat. |
public getIndividualChat(participant: string): Chat source
Obtains an individual chat with the specified user.
Params:
Name | Type | Attribute | Description |
participant | string | Address of the remote participant of the chat. |
public async sync() source
Synchronizes latest chat messages from the sever and reorders the chat list. This method needs to be called after initialization and every time session is resumed.