Merge pull request #3351 from matrix-org/t3chguy/pl_control_e2e

Expose power level toggle for enabling e2ee to room settings
This commit is contained in:
Michael Telatynski 2019-08-30 16:16:30 +01:00 committed by GitHub
commit de0719151f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -31,6 +31,7 @@ const plEventsToLabels = {
"m.room.power_levels": _td("Change permissions"), "m.room.power_levels": _td("Change permissions"),
"m.room.topic": _td("Change topic"), "m.room.topic": _td("Change topic"),
"m.room.tombstone": _td("Upgrade the room"), "m.room.tombstone": _td("Upgrade the room"),
"m.room.encryption": _td("Enable room encryption"),
"im.vector.modular.widgets": _td("Modify widgets"), "im.vector.modular.widgets": _td("Modify widgets"),
}; };
@ -44,6 +45,7 @@ const plEventsToShow = {
"m.room.power_levels": {isState: true}, "m.room.power_levels": {isState: true},
"m.room.topic": {isState: true}, "m.room.topic": {isState: true},
"m.room.tombstone": {isState: true}, "m.room.tombstone": {isState: true},
"m.room.encryption": {isState: true},
"im.vector.modular.widgets": {isState: true}, "im.vector.modular.widgets": {isState: true},
}; };
@ -304,6 +306,11 @@ export default class RolesRoomSettingsTab extends React.Component {
</div>; </div>;
}); });
// hide the power level selector for enabling E2EE if it the room is already encrypted
if (client.isRoomEncrypted(this.props.roomId)) {
delete eventsLevels["m.room.encryption"];
}
const eventPowerSelectors = Object.keys(eventsLevels).map((eventType, i) => { const eventPowerSelectors = Object.keys(eventsLevels).map((eventType, i) => {
let label = plEventsToLabels[eventType]; let label = plEventsToLabels[eventType];
if (label) { if (label) {

View file

@ -681,6 +681,7 @@
"Change permissions": "Change permissions", "Change permissions": "Change permissions",
"Change topic": "Change topic", "Change topic": "Change topic",
"Upgrade the room": "Upgrade the room", "Upgrade the room": "Upgrade the room",
"Enable room encryption": "Enable room encryption",
"Modify widgets": "Modify widgets", "Modify widgets": "Modify widgets",
"Failed to unban": "Failed to unban", "Failed to unban": "Failed to unban",
"Unban": "Unban", "Unban": "Unban",