Skip to content
Snippets Groups Projects
Unverified Commit 157ce58f authored by Anton Georgiev's avatar Anton Georgiev Committed by GitHub
Browse files

Merge pull request #6018 from antobinary/lock-public-chat

[HTML5] Comply with lock settings for chat
parents 7163bbf3 e03eccab
No related branches found
No related tags found
No related merge requests found
...@@ -105,15 +105,14 @@ const isChatLocked = (receiverID) => { ...@@ -105,15 +105,14 @@ 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';
return (isPublic && isPubChatLocked && isViewer && user.locked) return mapUser(user).isLocked &&
|| (!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