Merge pull request #5386 from jfsiebel/fix-direct-message-problem
Fix private chat messages
This commit is contained in:
commit
768a8733eb
@ -1,4 +1,5 @@
|
||||
import WhiteboardMultiUser from '/imports/api/whiteboard-multi-user/';
|
||||
import Users from '/imports/api/users';
|
||||
|
||||
const MSG_DIRECT_TYPE = 'DIRECT';
|
||||
const NODE_USER = 'nodeJSapp';
|
||||
@ -16,8 +17,16 @@ export const indexOf = [].indexOf || function (item) {
|
||||
export const processForHTML5ServerOnly = fn => (message, ...args) => {
|
||||
const { envelope } = message;
|
||||
const { routing } = envelope;
|
||||
const { msgType, meetingId, userId } = routing;
|
||||
|
||||
const shouldSkip = routing.msgType === MSG_DIRECT_TYPE && routing.userId !== NODE_USER;
|
||||
const selector = {
|
||||
userId,
|
||||
meetingId,
|
||||
};
|
||||
|
||||
const user = Users.findOne(selector);
|
||||
|
||||
const shouldSkip = user && msgType === MSG_DIRECT_TYPE && userId !== NODE_USER && user.clientType !== 'HTML5';
|
||||
if (shouldSkip) return () => { };
|
||||
return fn(message, ...args);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user