From feb8fe9e342daafc32efd5149477c391ec8caff6 Mon Sep 17 00:00:00 2001 From: Bettenbuk Zoltan Date: Wed, 1 Apr 2020 10:21:18 +0200 Subject: [PATCH] api: add private message flag to outgoingMessage --- modules/API/API.js | 6 ++++-- react/features/chat/middleware.js | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) 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);