Use the libQuotient function to get the user power level as it is now equivalent

This commit is contained in:
James Graham
2025-01-11 13:17:10 +00:00
parent aa95bc62bd
commit a2f5a585e3
5 changed files with 6 additions and 31 deletions

View File

@@ -118,7 +118,7 @@ Kirigami.Dialog {
}
FormCard.FormButtonDelegate {
visible: root.room && root.user.id !== root.connection.localUserId && room.canSendState("kick") && room.containsUser(root.user.id) && room.getUserPowerLevel(root.user.id) < room.getUserPowerLevel(root.connection.localUserId)
visible: root.room && root.user.id !== root.connection.localUserId && room.canSendState("kick") && room.containsUser(root.user.id) && room.memberEffectivePowerLevel(root.user.id) < room.memberEffectivePowerLevel(root.connection.localUserId)
action: Kirigami.Action {
text: i18n("Kick this user")
@@ -156,7 +156,7 @@ Kirigami.Dialog {
}
FormCard.FormButtonDelegate {
visible: root.room && root.user.id !== root.connection.localUserId && room.canSendState("ban") && !room.isUserBanned(root.user.id) && room.getUserPowerLevel(root.user.id) < room.getUserPowerLevel(root.connection.localUserId)
visible: root.room && root.user.id !== root.connection.localUserId && room.canSendState("ban") && !room.isUserBanned(root.user.id) && room.memberEffectivePowerLevel(root.user.id) < room.memberEffectivePowerLevel(root.connection.localUserId)
action: Kirigami.Action {
text: i18n("Ban this user")
@@ -203,7 +203,7 @@ Kirigami.Dialog {
let dialog = powerLevelDialog.createObject(this, {
room: root.room,
userId: root.user.id,
powerLevel: root.room.getUserPowerLevel(root.user.id)
powerLevel: root.room.memberEffectivePowerLevel(root.user.id)
});
dialog.open();
root.close();