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

Wrap deactivation check with sanity conditions #3437

Merged
merged 3 commits into from
Sep 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/views/rooms/MemberInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,19 @@ module.exports = createReactClass({
},

_calculateOpsPermissions: async function(member) {
let canDeactivate = false;
if (this.context.matrixClient) {
try {
canDeactivate = await this.context.matrixClient.isSynapseAdministrator();
turt2live marked this conversation as resolved.
Show resolved Hide resolved
} catch (e) {
console.error(e);
}
}

const defaultPerms = {
can: {
// Calculate permissions for Synapse before doing the PL checks
synapseDeactivate: await this.context.matrixClient.isSynapseAdministrator(),
synapseDeactivate: canDeactivate,
},
muted: false,
};
Expand Down