Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

api: add private message flag to outgoingMessage

Bettenbuk Zoltanfeb8fe9e342d
diff --git a/modules/API/API.js b/modules/API/API.js
index 76306c28c8..cd7b87f9ee 100644
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -369,12 +369,14 @@ class API {
* Notify external application (if API is enabled) that message was sent.
*
* @param {string} message - Message body.
+ * @param {boolean} privateMessage - True if the message was a private message.
* @returns {void}
*/
- notifySendingChatMessage(message: string) {
+ notifySendingChatMessage(message: string, privateMessage: boolean) {
this._sendEvent({
name: 'outgoing-message',
- message
+ message,
+ privateMessage
});
}
diff --git a/react/features/chat/middleware.js b/react/features/chat/middleware.js
index 089e960f9a..97fe9d32cc 100644
--- a/react/features/chat/middleware.js
+++ b/react/features/chat/middleware.js
@@ -76,12 +76,12 @@ MiddlewareRegistry.register(store => next => action => {
} else {
// Sending the message if privacy notice doesn't need to be shown.
+ const { privateMessageRecipient } = state['features/chat'];
+
if (typeof APP !== 'undefined') {
- APP.API.notifySendingChatMessage(action.message);
+ APP.API.notifySendingChatMessage(action.message, Boolean(privateMessageRecipient));
}
- const { privateMessageRecipient } = state['features/chat'];
-
if (privateMessageRecipient) {
conference.sendPrivateTextMessage(privateMessageRecipient.id, action.message);
_persistSentPrivateMessage(store, privateMessageRecipient.id, action.message);