api: add private message flag to outgoingMessage

pull/5530/head jitsi-meet_4361
Bettenbuk Zoltan 5 years ago committed by Zoltan Bettenbuk
parent aff6d4b36d
commit feb8fe9e34
  1. 6
      modules/API/API.js
  2. 6
      react/features/chat/middleware.js

@ -369,12 +369,14 @@ class API {
* Notify external application (if API is enabled) that message was sent. * Notify external application (if API is enabled) that message was sent.
* *
* @param {string} message - Message body. * @param {string} message - Message body.
* @param {boolean} privateMessage - True if the message was a private message.
* @returns {void} * @returns {void}
*/ */
notifySendingChatMessage(message: string) { notifySendingChatMessage(message: string, privateMessage: boolean) {
this._sendEvent({ this._sendEvent({
name: 'outgoing-message', name: 'outgoing-message',
message message,
privateMessage
}); });
} }

@ -76,12 +76,12 @@ MiddlewareRegistry.register(store => next => action => {
} else { } else {
// Sending the message if privacy notice doesn't need to be shown. // Sending the message if privacy notice doesn't need to be shown.
const { privateMessageRecipient } = state['features/chat'];
if (typeof APP !== 'undefined') { if (typeof APP !== 'undefined') {
APP.API.notifySendingChatMessage(action.message); APP.API.notifySendingChatMessage(action.message, Boolean(privateMessageRecipient));
} }
const { privateMessageRecipient } = state['features/chat'];
if (privateMessageRecipient) { if (privateMessageRecipient) {
conference.sendPrivateTextMessage(privateMessageRecipient.id, action.message); conference.sendPrivateTextMessage(privateMessageRecipient.id, action.message);
_persistSentPrivateMessage(store, privateMessageRecipient.id, action.message); _persistSentPrivateMessage(store, privateMessageRecipient.id, action.message);

Loading…
Cancel
Save