소스 검색

api: add private message flag to outgoingMessage

j8
Bettenbuk Zoltan 5 년 전
부모
커밋
feb8fe9e34
2개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 4
    2
      modules/API/API.js
  2. 3
    3
      react/features/chat/middleware.js

+ 4
- 2
modules/API/API.js 파일 보기

@@ -369,12 +369,14 @@ class API {
369 369
      * Notify external application (if API is enabled) that message was sent.
370 370
      *
371 371
      * @param {string} message - Message body.
372
+     * @param {boolean} privateMessage - True if the message was a private message.
372 373
      * @returns {void}
373 374
      */
374
-    notifySendingChatMessage(message: string) {
375
+    notifySendingChatMessage(message: string, privateMessage: boolean) {
375 376
         this._sendEvent({
376 377
             name: 'outgoing-message',
377
-            message
378
+            message,
379
+            privateMessage
378 380
         });
379 381
     }
380 382
 

+ 3
- 3
react/features/chat/middleware.js 파일 보기

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

Loading…
취소
저장