From 291168ccdb0e25c65f681d74a3487146056fbbb2 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 10 Jul 2020 12:34:59 -0400 Subject: [PATCH] Disable member kick/ban while offline --- .../Chat/RoomPane/MemberView/MemberDelegate.qml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml index fed7c12f..f2cdfec4 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml @@ -92,10 +92,12 @@ HTile { } HMenuItemPopupSpawner { + property bool permissionToKick: false + icon.name: "room-kick" icon.color: theme.colors.negativeBackground text: model.invited ? qsTr("Disinvite") : qsTr("Kick") - enabled: false + enabled: chat.userInfo.presence !== "offline" && permissionToKick popup: "Popups/RemoveMemberPopup.qml" properties: ({ @@ -110,15 +112,17 @@ HTile { chat.userId, "can_kick", [chat.roomId, model.id], - can => { enabled = can }, + can => { permissionToKick = can }, ) } HMenuItemPopupSpawner { + property bool permissionToBan: false + icon.name: "room-ban" icon.color: theme.colors.negativeBackground text: qsTr("Ban") - enabled: false + enabled: chat.userInfo.presence !== "offline" && permissionToBan popup: "Popups/RemoveMemberPopup.qml" properties: ({ @@ -133,7 +137,7 @@ HTile { chat.userId, "can_ban", [chat.roomId, model.id], - can => { enabled = can }, + can => { permissionToBan = can }, ) } }