Disable room context menu entries while offline

Except "Copy room ID"
This commit is contained in:
miruka 2020-07-10 12:49:55 -04:00
parent 7580686598
commit 12b6b74881

View File

@ -115,7 +115,7 @@ HTile {
contextMenu: HMenu {
HMenuItemPopupSpawner {
visible: joined
enabled: model.can_invite
enabled: model.can_invite && accountModel.presence !== "offline"
icon.name: "room-send-invite"
text: qsTr("Invite members")
@ -142,6 +142,7 @@ HTile {
model.inviter_name, model.inviter_id
))
label.textFormat: Text.StyledText
enabled: accountModel.presence !== "offline"
onTriggered: py.callClientCoro(
model.for_account, "join", [model.id]
@ -153,6 +154,7 @@ HTile {
icon.name: invited ? "invite-decline" : "room-leave"
icon.color: theme.colors.negativeBackground
text: invited ? qsTr("Decline invite") : qsTr("Leave")
enabled: accountModel.presence !== "offline"
popup: "Popups/LeaveRoomPopup.qml"
properties: ({
@ -166,6 +168,7 @@ HTile {
icon.name: "room-forget"
icon.color: theme.colors.negativeBackground
text: qsTr("Forget")
enabled: accountModel.presence !== "offline"
popup: "Popups/ForgetRoomPopup.qml"
autoDestruct: false