Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3437 from matrix-org/travis/fix-deactivate
Browse files Browse the repository at this point in the history
Wrap deactivation check with sanity conditions
  • Loading branch information
turt2live committed Sep 13, 2019
2 parents 7afd80e + 3150d65 commit e18b38c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/views/rooms/MemberInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,15 @@ module.exports = createReactClass({
},

_calculateOpsPermissions: async function(member) {
let canDeactivate = false;
if (this.context.matrixClient) {
canDeactivate = await this.context.matrixClient.isSynapseAdministrator();
}

const defaultPerms = {
can: {
// Calculate permissions for Synapse before doing the PL checks
synapseDeactivate: await this.context.matrixClient.isSynapseAdministrator(),
synapseDeactivate: canDeactivate,
},
muted: false,
};
Expand All @@ -668,7 +673,7 @@ module.exports = createReactClass({
};
},

_calculateCanPermissions: async function(me, them, powerLevels) {
_calculateCanPermissions: function(me, them, powerLevels) {
const isMe = me.userId === them.userId;
const can = {
kick: false,
Expand Down

0 comments on commit e18b38c

Please sign in to comment.