Set power level from userdetaildialog

Add the option to set powerlevel to userdetaildialog.

This is done by making the powerleveldialog into it's own file and using that.

implements network/neochat#570
This commit is contained in:
James Graham
2023-03-05 22:44:04 +00:00
committed by Tobias Fella
parent e6a060c192
commit bd4eeb405b
6 changed files with 115 additions and 37 deletions

View File

@@ -139,6 +139,29 @@ Kirigami.OverlaySheet {
}
}
}
Kirigami.BasicListItem {
visible: room.canSendState("m.room.power_levels")
action: Kirigami.Action {
text: i18n("Set user power level")
icon.name: "visibility"
onTriggered: {
let dialog = powerLevelDialog.createObject(applicationWindow().overlay, {
room: root.room,
userId: root.user.id,
powerLevel: root.room.getUserPowerLevel(root.user.id)
});
dialog.open()
root.close()
}
}
Component {
id: powerLevelDialog
PowerLevelDialog {
id: powerLevelDialog
}
}
}
Kirigami.BasicListItem {
visible: user === room.localUser || room.canSendState("redact")