Properly check power levels before allowing kick

This commit is contained in:
miruka
2020-04-19 16:50:19 -04:00
parent 2a0a3765fc
commit 2d231b7af1
2 changed files with 22 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ HTileDelegate {
icon.name: "room-kick"
icon.color: theme.colors.negativeBackground
text: model.invited ? qsTr("Disinvite") : qsTr("Kick")
enabled: chat.roomInfo.can_kick
enabled: false
popup: "Popups/KickPopup.qml"
popupParent: chat
@@ -68,6 +68,13 @@ HTileDelegate {
targetDisplayName: model.display_name,
targetIsInvited: model.invited,
})
Component.onCompleted: py.callClientCoro(
chat.userId,
"can_kick",
[chat.roomId, model.id],
can => { enabled = can },
)
}
}