[IMPROVE] Add Jitsi button to Teams (#3223)

* [IMPROVE] Add Jitsi button to teams

* Added setting to check is Jitsi is Enable for Channel too

* Fix typo

Co-authored-by: Gerzon Z <gerzonc@icloud.com>
Co-authored-by: Gerzon Z <gerzonzcanario@gmail.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Reinaldo Neto 2021-07-02 16:15:21 -03:00 committed by GitHub
parent 46689930c3
commit 58d21be195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -196,5 +196,11 @@ export default {
},
Accounts_AllowInvisibleStatusOption: {
type: 'valueAsString'
},
Jitsi_Enable_Teams: {
type: 'valueAsBoolean'
},
Jitsi_Enable_Channels: {
type: 'valuesAsBoolean'
}
};

View File

@ -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 (
<List.Section>
<List.Separator />
@ -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,