feat(external_api) add event for chat updates (unread counter, open state)

This commit is contained in:
Tudor-Ovidiu Avram
2021-01-28 11:39:17 +02:00
parent 63f0166f75
commit dcaad41e69
3 changed files with 42 additions and 2 deletions

View File

@@ -556,6 +556,21 @@ class API {
}
}
/**
* Notify external application (if API is enabled) that the chat state has been updated.
*
* @param {number} unreadCount - The unread messages counter.
* @param {boolean} isOpen - True if the chat panel is open.
* @returns {void}
*/
notifyChatUpdated(unreadCount: number, isOpen: boolean) {
this._sendEvent({
name: 'chat-updated',
unreadCount,
isOpen
});
}
/**
* Notify external application (if API is enabled) that message was sent.
*