Skip direct messages of flash client
This commit is contained in:
parent
d259a875f6
commit
d9f90943ee
3
bigbluebutton-html5/imports/api/annotations/server/eventHandlers.js
Normal file → Executable file
3
bigbluebutton-html5/imports/api/annotations/server/eventHandlers.js
Normal file → Executable file
@ -1,4 +1,5 @@
|
||||
import RedisPubSub from '/imports/startup/server/redis';
|
||||
import { skipFlashDirectEvent } from '/imports/api/common/server/helpers';
|
||||
import handleWhiteboardCleared from './handlers/whiteboardCleared';
|
||||
import handleWhiteboardUndo from './handlers/whiteboardUndo';
|
||||
import handleWhiteboardSend from './handlers/whiteboardSend';
|
||||
@ -7,4 +8,4 @@ import handleWhiteboardAnnotations from './handlers/whiteboardAnnotations';
|
||||
RedisPubSub.on('ClearWhiteboardEvtMsg', handleWhiteboardCleared);
|
||||
RedisPubSub.on('UndoWhiteboardEvtMsg', handleWhiteboardUndo);
|
||||
RedisPubSub.on('SendWhiteboardAnnotationEvtMsg', handleWhiteboardSend);
|
||||
RedisPubSub.on('GetWhiteboardAnnotationsRespMsg', handleWhiteboardAnnotations);
|
||||
RedisPubSub.on('GetWhiteboardAnnotationsRespMsg', skipFlashDirectEvent(handleWhiteboardAnnotations));
|
||||
|
3
bigbluebutton-html5/imports/api/captions/server/eventHandlers.js
Normal file → Executable file
3
bigbluebutton-html5/imports/api/captions/server/eventHandlers.js
Normal file → Executable file
@ -1,9 +1,10 @@
|
||||
import RedisPubSub from '/imports/startup/server/redis';
|
||||
import { skipFlashDirectEvent } from '/imports/api/common/server/helpers';
|
||||
import handleCaptionHistory from './handlers/captionHistory';
|
||||
import handleCaptionUpdate from './handlers/captionUpdate';
|
||||
import handleCaptionOwnerUpdate from './handlers/captionOwnerUpdate';
|
||||
|
||||
// TODO
|
||||
RedisPubSub.on('SendCaptionHistoryRespMsg', handleCaptionHistory);
|
||||
RedisPubSub.on('SendCaptionHistoryRespMsg', skipFlashDirectEvent(handleCaptionHistory));
|
||||
RedisPubSub.on('EditCaptionHistoryEvtMsg', handleCaptionUpdate);
|
||||
RedisPubSub.on('UpdateCaptionOwnerEvtMsg', handleCaptionOwnerUpdate);
|
||||
|
5
bigbluebutton-html5/imports/api/chat/server/eventHandlers.js
Normal file → Executable file
5
bigbluebutton-html5/imports/api/chat/server/eventHandlers.js
Normal file → Executable file
@ -1,9 +1,10 @@
|
||||
import RedisPubSub from '/imports/startup/server/redis';
|
||||
import { skipFlashDirectEvent } from '/imports/api/common/server/helpers';
|
||||
import handleChatMessage from './handlers/chatMessage';
|
||||
import handleChatHistory from './handlers/chatHistory';
|
||||
import handleChatPublicHistoryClear from './handlers/chatPublicHistoryClear';
|
||||
|
||||
RedisPubSub.on('GetChatHistoryRespMsg', handleChatHistory);
|
||||
RedisPubSub.on('GetChatHistoryRespMsg', skipFlashDirectEvent(handleChatHistory));
|
||||
RedisPubSub.on('SendPublicMessageEvtMsg', handleChatMessage);
|
||||
RedisPubSub.on('SendPrivateMessageEvtMsg', handleChatMessage);
|
||||
RedisPubSub.on('SendPrivateMessageEvtMsg', skipFlashDirectEvent(handleChatMessage));
|
||||
RedisPubSub.on('ClearPublicChatHistoryEvtMsg', handleChatPublicHistoryClear);
|
||||
|
16
bigbluebutton-html5/imports/api/common/server/helpers.js
Normal file → Executable file
16
bigbluebutton-html5/imports/api/common/server/helpers.js
Normal file → Executable file
@ -1,5 +1,8 @@
|
||||
import WhiteboardMultiUser from '/imports/api/whiteboard-multi-user/';
|
||||
|
||||
const MSG_DIRECT_TYPE = 'DIRECT';
|
||||
const NODE_USER = 'nodeJSapp';
|
||||
|
||||
export const indexOf = [].indexOf || function (item) {
|
||||
for (let i = 0, l = this.length; i < l; i += 1) {
|
||||
if (i in this && this[i] === item) {
|
||||
@ -10,8 +13,17 @@ export const indexOf = [].indexOf || function (item) {
|
||||
return -1;
|
||||
};
|
||||
|
||||
// used in 1.1
|
||||
export const inReplyToHTML5Client = arg => arg.routing.userId === 'nodeJSapp';
|
||||
export const skipFlashDirectEvent = fn => (message, ...args) => {
|
||||
const { envelope } = message;
|
||||
const { routing } = envelope;
|
||||
|
||||
|
||||
const shouldSkip = routing.msgType === MSG_DIRECT_TYPE && routing.userId !== NODE_USER;
|
||||
if (shouldSkip) return () => { };
|
||||
|
||||
return fn(...args);
|
||||
};
|
||||
|
||||
|
||||
export const getMultiUserStatus = (meetingId) => {
|
||||
const data = WhiteboardMultiUser.findOne({ meetingId });
|
||||
|
3
bigbluebutton-html5/imports/api/voice-users/server/eventHandlers.js
Normal file → Executable file
3
bigbluebutton-html5/imports/api/voice-users/server/eventHandlers.js
Normal file → Executable file
@ -1,4 +1,5 @@
|
||||
import RedisPubSub from '/imports/startup/server/redis';
|
||||
import { skipFlashDirectEvent } from '/imports/api/common/server/helpers';
|
||||
import handleJoinVoiceUser from './handlers/joinVoiceUser';
|
||||
import handleLeftVoiceUser from './handlers/leftVoiceUser';
|
||||
import handleTalkingVoiceUser from './handlers/talkingVoiceUser';
|
||||
@ -9,4 +10,4 @@ RedisPubSub.on('UserLeftVoiceConfToClientEvtMsg', handleLeftVoiceUser);
|
||||
RedisPubSub.on('UserJoinedVoiceConfToClientEvtMsg', handleJoinVoiceUser);
|
||||
RedisPubSub.on('UserTalkingVoiceEvtMsg', handleTalkingVoiceUser);
|
||||
RedisPubSub.on('UserMutedVoiceEvtMsg', handleMutedVoiceUser);
|
||||
RedisPubSub.on('GetVoiceUsersMeetingRespMsg', handleGetVoiceUsers);
|
||||
RedisPubSub.on('GetVoiceUsersMeetingRespMsg', skipFlashDirectEvent(handleGetVoiceUsers));
|
||||
|
@ -1,6 +1,7 @@
|
||||
import RedisPubSub from '/imports/startup/server/redis';
|
||||
import { skipFlashDirectEvent } from '/imports/api/common/server/helpers';
|
||||
import handleGetWhiteboardAccess from './handlers/getWhiteboardAccess';
|
||||
|
||||
RedisPubSub.on('GetWhiteboardAccessRespMsg', handleGetWhiteboardAccess);
|
||||
RedisPubSub.on('GetWhiteboardAccessRespMsg', skipFlashDirectEvent(handleGetWhiteboardAccess));
|
||||
RedisPubSub.on('SyncGetWhiteboardAccessRespMsg', handleGetWhiteboardAccess);
|
||||
RedisPubSub.on('ModifyWhiteboardAccessEvtMsg', handleGetWhiteboardAccess);
|
||||
|
Loading…
Reference in New Issue
Block a user