Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(groupchat-polls-permissions): Adds UI setting to show the option. (#16807)

Дамян Минков0e53bd87ce16
diff --git a/config.js b/config.js
index 9d16dac2f4..b560e590be 100644
--- a/config.js
+++ b/config.js
@@ -151,6 +151,9 @@ var config = {
// Disables self-view settings in UI
// disableSelfViewSettings: false,
+ // Shows/hides the moderator setting for chat permissions.
+ // showChatPermissionsModeratorSetting: false,
+
// screenshotCapture : {
// Enables the screensharing capture feature.
// enabled: false,
diff --git a/lang/main.json b/lang/main.json
index 9424185b51..e6a7541f74 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -1190,7 +1190,7 @@
"signedIn": "Currently accessing calendar events for {{email}}. Click the Disconnect button below to stop accessing calendar events.",
"title": "Calendar"
},
- "chatWithPermissions": "Chat requires permission",
+ "chatWithPermissions": "Disable chat for non-moderators",
"desktopShareFramerate": "Desktop sharing frame rate",
"desktopShareHighFpsWarning": "A higher frame rate for desktop sharing might affect your bandwidth. You need to restart the screen share for the new settings to take effect.",
"desktopShareWarning": "You need to restart the screen share for the new settings to take effect.",
diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts
index 7351c3d448..eed32a999d 100644
--- a/react/features/base/config/configType.ts
+++ b/react/features/base/config/configType.ts
@@ -582,6 +582,7 @@ export interface IConfig {
};
serviceUrl?: string;
sharedVideoAllowedURLDomains?: Array<string>;
+ showChatPermissionsModeratorSetting?: boolean;
sipInviteUrl?: string;
speakerStats?: {
disableSearch?: boolean;
diff --git a/react/features/base/config/configWhitelist.ts b/react/features/base/config/configWhitelist.ts
index 653ca730a2..5d0520c500 100644
--- a/react/features/base/config/configWhitelist.ts
+++ b/react/features/base/config/configWhitelist.ts
@@ -220,6 +220,7 @@ export default [
'resolution',
'screenshotCapture',
'securityUi',
+ 'showChatPermissionsModeratorSetting',
'speakerStats',
'startAudioMuted',
'startAudioOnly',
diff --git a/react/features/settings/components/web/ModeratorTab.tsx b/react/features/settings/components/web/ModeratorTab.tsx
index 9e8a472af9..cdb52474e8 100644
--- a/react/features/settings/components/web/ModeratorTab.tsx
+++ b/react/features/settings/components/web/ModeratorTab.tsx
@@ -27,11 +27,6 @@ export interface IProps extends AbstractDialogTabProps, WithTranslation {
*/
classes?: Partial<Record<keyof ReturnType<typeof styles>, string>>;
- /**
- * Whether to hide chat with permissions.
- */
- disableChatWithPermissions: boolean;
-
/**
* If set hides the reactions moderation setting.
*/
@@ -57,6 +52,11 @@ export interface IProps extends AbstractDialogTabProps, WithTranslation {
*/
followMeRecorderEnabled: boolean;
+ /**
+ * Whether to hide chat with permissions.
+ */
+ hideChatWithPermissions: boolean;
+
/**
* Whether or not the user has selected the Start Audio Muted feature to be
* enabled.
@@ -210,12 +210,12 @@ class ModeratorTab extends AbstractDialogTab<IProps, any> {
const {
audioModerationEnabled,
chatWithPermissionsEnabled,
- disableChatWithPermissions,
disableReactionsModeration,
followMeActive,
followMeEnabled,
followMeRecorderActive,
followMeRecorderEnabled,
+ hideChatWithPermissions,
startAudioMuted,
startVideoMuted,
startReactionsMuted,
@@ -266,7 +266,7 @@ class ModeratorTab extends AbstractDialogTab<IProps, any> {
label = { t('settings.startReactionsMuted') }
name = 'start-reactions-muted'
onChange = { this._onStartReactionsMutedChanged } /> }
- { !disableChatWithPermissions
+ { !hideChatWithPermissions
&& <Checkbox
checked = { chatWithPermissionsEnabled }
className = { classes.checkbox }
diff --git a/react/features/settings/functions.any.ts b/react/features/settings/functions.any.ts
index e69d3a8a10..d6c00f0208 100644
--- a/react/features/settings/functions.any.ts
+++ b/react/features/settings/functions.any.ts
@@ -162,12 +162,12 @@ export function getModeratorTabProps(stateful: IStateful) {
} = state['features/base/conference'];
const { followMeEnabled, followMeRecorderEnabled } = state['features/follow-me'];
const { groupChatWithPermissions } = state['features/chat'];
- const { disableReactionsModeration } = state['features/base/config'];
+ const { showChatPermissionsModeratorSetting, disableReactionsModeration } = state['features/base/config'];
const followMeActive = isFollowMeActive(state);
const followMeRecorderActive = isFollowMeRecorderActive(state);
const showModeratorSettings = shouldShowModeratorSettings(state);
const conferenceMetadata = conference?.getMetadataHandler()?.getMetadata();
- const disableChatWithPermissions = !conferenceMetadata?.allownersEnabled;
+ const hideChatWithPermissions = !showChatPermissionsModeratorSetting || conferenceMetadata?.allownersEnabled;
const isAudioModerationEnabled = isEnabledFromState(MEDIA_TYPE.AUDIO, state);
const isVideoModerationEnabled = isEnabledFromState(MEDIA_TYPE.VIDEO, state);
@@ -177,12 +177,12 @@ export function getModeratorTabProps(stateful: IStateful) {
videoModerationEnabled: isVideoModerationEnabled,
chatWithPermissionsEnabled: Boolean(groupChatWithPermissions),
showModeratorSettings: Boolean(conference && showModeratorSettings),
- disableChatWithPermissions: Boolean(disableChatWithPermissions),
disableReactionsModeration: Boolean(disableReactionsModeration),
followMeActive: Boolean(conference && followMeActive),
followMeEnabled: Boolean(conference && followMeEnabled),
followMeRecorderActive: Boolean(conference && followMeRecorderActive),
followMeRecorderEnabled: Boolean(conference && followMeRecorderEnabled),
+ hideChatWithPermissions: Boolean(hideChatWithPermissions),
startReactionsMuted: Boolean(conference && startReactionsMuted),
startAudioMuted: Boolean(conference && startAudioMutedPolicy),
startVideoMuted: Boolean(conference && startVideoMutedPolicy)
diff --git a/resources/prosody-plugins/mod_muc_allowners.lua b/resources/prosody-plugins/mod_muc_allowners.lua
index 54e7b9df96..f5e93b095a 100644
--- a/resources/prosody-plugins/mod_muc_allowners.lua
+++ b/resources/prosody-plugins/mod_muc_allowners.lua
@@ -30,7 +30,8 @@ module:hook("muc-room-created", function(event)
local room = event.room;
if room.jitsiMetadata then
- room.jitsiMetadata.allownersEnabled = true;
+ -- indicates whether all participants in the room will be moderators
+ room.jitsiMetadata.allownersEnabled = not is_moderated(room.jid);
end
end, -2); -- room_metadata should run before this module on -1