Skip to content
Snippets Groups Projects
Commit e756ce15 authored by Anton Georgiev's avatar Anton Georgiev
Browse files

comply to lock settings for chat

parent 6159fa1e
No related branches found
No related tags found
No related merge requests found
...@@ -105,15 +105,15 @@ const isChatLocked = (receiverID) => { ...@@ -105,15 +105,15 @@ const isChatLocked = (receiverID) => {
const isPublic = receiverID === PUBLIC_CHAT_ID; const isPublic = receiverID === PUBLIC_CHAT_ID;
const meeting = Meetings.findOne({}); const meeting = Meetings.findOne({});
const user = Users.findOne({}); const user = Users.findOne({ userId: Auth.userID });
if (meeting.lockSettingsProp !== undefined) { if (meeting.lockSettingsProp !== undefined) {
const isPubChatLocked = meeting.lockSettingsProp.disablePubChat; const isPubChatLocked = meeting.lockSettingsProp.disablePubChat;
const isPrivChatLocked = meeting.lockSettingsProp.disablePrivChat; const isPrivChatLocked = meeting.lockSettingsProp.disablePrivChat;
const isViewer = user.role === 'VIEWER'; const isViewer = user.role === 'VIEWER';
return (isPublic && isPubChatLocked && isViewer && user.locked) return isViewer && user.locked &&
|| (!isPublic && isPrivChatLocked && isViewer && user.locked); ((isPublic && isPubChatLocked) || (!isPublic && isPrivChatLocked));
} }
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment