comply to lock settings for chat

This commit is contained in:
Anton Georgiev 2018-08-29 16:00:53 +00:00
parent 6159fa1ed9
commit e756ce1548

View File

@ -105,15 +105,15 @@ const isChatLocked = (receiverID) => {
const isPublic = receiverID === PUBLIC_CHAT_ID;
const meeting = Meetings.findOne({});
const user = Users.findOne({});
const user = Users.findOne({ userId: Auth.userID });
if (meeting.lockSettingsProp !== undefined) {
const isPubChatLocked = meeting.lockSettingsProp.disablePubChat;
const isPrivChatLocked = meeting.lockSettingsProp.disablePrivChat;
const isViewer = user.role === 'VIEWER';
return (isPublic && isPubChatLocked && isViewer && user.locked)
|| (!isPublic && isPrivChatLocked && isViewer && user.locked);
return isViewer && user.locked &&
((isPublic && isPubChatLocked) || (!isPublic && isPrivChatLocked));
}
return false;