allow html5 viewers to chat with moderators

This commit is contained in:
Chad Pilkey 2019-02-25 15:31:33 -08:00
parent 5a6d067e98
commit 97f84dec43
2 changed files with 13 additions and 6 deletions

View File

@ -20,6 +20,8 @@ const PRIVATE_CHAT_TYPE = CHAT_CONFIG.type_private;
const PUBLIC_CHAT_USER_ID = CHAT_CONFIG.system_userid;
const PUBLIC_CHAT_CLEAR = CHAT_CONFIG.system_messages_keys.chat_clear;
const ROLE_MODERATOR = Meteor.settings.public.user.role_moderator;
const ScrollCollection = new Mongo.Collection(null);
const UnsentMessagesCollection = new Mongo.Collection(null);
@ -135,11 +137,14 @@ const isChatLocked = (receiverID) => {
const user = Users.findOne({ userId: Auth.userID });
if (meeting.lockSettingsProp !== undefined) {
const isPubChatLocked = meeting.lockSettingsProp.disablePubChat;
const isPrivChatLocked = meeting.lockSettingsProp.disablePrivChat;
return mapUser(user).isLocked
&& ((isPublic && isPubChatLocked) || (!isPublic && isPrivChatLocked));
if (mapUser(user).isLocked) {
if (isPublic) {
return meeting.lockSettingsProp.disablePubChat;
}
const receivingUser = Users.findOne({ userId: receiverID });
const receiverIsMod = receivingUser && receivingUser.role === ROLE_MODERATOR;
return !receiverIsMod && meeting.lockSettingsProp.disablePrivChat;
}
}
return false;

View File

@ -226,7 +226,9 @@ class UserDropdown extends PureComponent {
const enablePrivateChat = currentUser.isModerator
? allowedToChatPrivately
: allowedToChatPrivately
&& (!disablePrivChat || (disablePrivChat && hasPrivateChatBetweenUsers(currentUser, user)));
&& (!(user.locked && disablePrivChat)
|| hasPrivateChatBetweenUsers(currentUser, user)
|| user.isModerator);
if (showNestedOptions) {
if (allowedToChangeStatus) {