Disable member kick/ban while offline
This commit is contained in:
parent
f018b9567b
commit
291168ccdb
|
@ -92,10 +92,12 @@ HTile {
|
||||||
}
|
}
|
||||||
|
|
||||||
HMenuItemPopupSpawner {
|
HMenuItemPopupSpawner {
|
||||||
|
property bool permissionToKick: false
|
||||||
|
|
||||||
icon.name: "room-kick"
|
icon.name: "room-kick"
|
||||||
icon.color: theme.colors.negativeBackground
|
icon.color: theme.colors.negativeBackground
|
||||||
text: model.invited ? qsTr("Disinvite") : qsTr("Kick")
|
text: model.invited ? qsTr("Disinvite") : qsTr("Kick")
|
||||||
enabled: false
|
enabled: chat.userInfo.presence !== "offline" && permissionToKick
|
||||||
|
|
||||||
popup: "Popups/RemoveMemberPopup.qml"
|
popup: "Popups/RemoveMemberPopup.qml"
|
||||||
properties: ({
|
properties: ({
|
||||||
|
@ -110,15 +112,17 @@ HTile {
|
||||||
chat.userId,
|
chat.userId,
|
||||||
"can_kick",
|
"can_kick",
|
||||||
[chat.roomId, model.id],
|
[chat.roomId, model.id],
|
||||||
can => { enabled = can },
|
can => { permissionToKick = can },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
HMenuItemPopupSpawner {
|
HMenuItemPopupSpawner {
|
||||||
|
property bool permissionToBan: false
|
||||||
|
|
||||||
icon.name: "room-ban"
|
icon.name: "room-ban"
|
||||||
icon.color: theme.colors.negativeBackground
|
icon.color: theme.colors.negativeBackground
|
||||||
text: qsTr("Ban")
|
text: qsTr("Ban")
|
||||||
enabled: false
|
enabled: chat.userInfo.presence !== "offline" && permissionToBan
|
||||||
|
|
||||||
popup: "Popups/RemoveMemberPopup.qml"
|
popup: "Popups/RemoveMemberPopup.qml"
|
||||||
properties: ({
|
properties: ({
|
||||||
|
@ -133,7 +137,7 @@ HTile {
|
||||||
chat.userId,
|
chat.userId,
|
||||||
"can_ban",
|
"can_ban",
|
||||||
[chat.roomId, model.id],
|
[chat.roomId, model.id],
|
||||||
can => { enabled = can },
|
can => { permissionToBan = can },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user