diff --git a/app/constants/settings.js b/app/constants/settings.js index d684a11c1..14ad8fb36 100644 --- a/app/constants/settings.js +++ b/app/constants/settings.js @@ -196,5 +196,11 @@ export default { }, Accounts_AllowInvisibleStatusOption: { type: 'valueAsString' + }, + Jitsi_Enable_Teams: { + type: 'valueAsBoolean' + }, + Jitsi_Enable_Channels: { + type: 'valuesAsBoolean' } }; diff --git a/app/views/RoomActionsView/index.js b/app/views/RoomActionsView/index.js index d16ea5768..75c977a28 100644 --- a/app/views/RoomActionsView/index.js +++ b/app/views/RoomActionsView/index.js @@ -50,6 +50,8 @@ class RoomActionsView extends React.Component { route: PropTypes.object, leaveRoom: PropTypes.func, jitsiEnabled: PropTypes.bool, + jitsiEnableTeams: PropTypes.bool, + jitsiEnableChannels: PropTypes.bool, encryptionEnabled: PropTypes.bool, setLoadingInvite: PropTypes.func, closeRoom: PropTypes.func, @@ -655,10 +657,15 @@ class RoomActionsView extends React.Component { renderJitsi = () => { const { room } = this.state; - const { jitsiEnabled } = this.props; - if (!jitsiEnabled || room.teamMain) { + const { jitsiEnabled, jitsiEnableTeams, jitsiEnableChannels } = this.props; + + const isJitsiDisabledForTeams = room.teamMain && !jitsiEnableTeams; + const isJitsiDisabledForChannels = !room.teamMain && (room.t === 'p' || room.t === 'c') && !jitsiEnableChannels; + + if (!jitsiEnabled || isJitsiDisabledForTeams || isJitsiDisabledForChannels) { return null; } + return ( @@ -1078,6 +1085,8 @@ class RoomActionsView extends React.Component { const mapStateToProps = state => ({ jitsiEnabled: state.settings.Jitsi_Enabled || false, + jitsiEnableTeams: state.settings.Jitsi_Enable_Teams || false, + jitsiEnableChannels: state.settings.Jitsi_Enable_Channels || false, encryptionEnabled: state.encryption.enabled, serverVersion: state.server.version, isMasterDetail: state.app.isMasterDetail,