Add "invite members" to room context menu
This commit is contained in:
parent
55506dd10e
commit
a493b0cf61
3
TODO.md
3
TODO.md
@ -1,6 +1,6 @@
|
|||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
- invite keybind & context menu
|
- invite keybind
|
||||||
- better cancel for all boxes + disablewhileloading false
|
- better cancel for all boxes + disablewhileloading false
|
||||||
- use defaulttext/checked elsewhere
|
- use defaulttext/checked elsewhere
|
||||||
|
|
||||||
@ -134,6 +134,7 @@
|
|||||||
|
|
||||||
## Backend
|
## Backend
|
||||||
|
|
||||||
|
- Saving the room settings
|
||||||
- Refetch profile after manual profile change, don't wait for a room event
|
- Refetch profile after manual profile change, don't wait for a room event
|
||||||
|
|
||||||
- Prevent starting multiple client instances, causes problems with E2E DB
|
- Prevent starting multiple client instances, causes problems with E2E DB
|
||||||
|
@ -21,7 +21,9 @@ HTileDelegate {
|
|||||||
Behavior on opacity { HOpacityAnimator {} }
|
Behavior on opacity { HOpacityAnimator {} }
|
||||||
|
|
||||||
|
|
||||||
readonly property bool invited: model.data.inviter_id && ! model.data.left
|
readonly property bool joined: ! invited && ! parted
|
||||||
|
readonly property bool invited: model.data.inviter_id && ! parted
|
||||||
|
readonly property bool parted: model.data.left
|
||||||
readonly property var lastEvent: model.data.last_event
|
readonly property var lastEvent: model.data.last_event
|
||||||
|
|
||||||
|
|
||||||
@ -88,6 +90,23 @@ HTileDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
contextMenu: HMenu {
|
contextMenu: HMenu {
|
||||||
|
HMenuItem {
|
||||||
|
visible: joined
|
||||||
|
enabled: model.data.can_invite
|
||||||
|
icon.name: "room-send-invite"
|
||||||
|
text: qsTr("Invite members")
|
||||||
|
|
||||||
|
onTriggered: Utils.makePopup(
|
||||||
|
"Popups/InviteToRoomPopup.qml",
|
||||||
|
window,
|
||||||
|
{
|
||||||
|
userId: model.user_id,
|
||||||
|
roomId: model.data.room_id,
|
||||||
|
invitingAllowed: Qt.binding(() => model.data.can_invite)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
HMenuItem {
|
HMenuItem {
|
||||||
icon.name: "copy-room-id"
|
icon.name: "copy-room-id"
|
||||||
text: qsTr("Copy room ID")
|
text: qsTr("Copy room ID")
|
||||||
@ -109,7 +128,7 @@ HTileDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HMenuItem {
|
HMenuItem {
|
||||||
visible: ! model.data.left
|
visible: invited || joined
|
||||||
icon.name: invited ? "invite-decline" : "room-leave"
|
icon.name: invited ? "invite-decline" : "room-leave"
|
||||||
icon.color: theme.colors.negativeBackground
|
icon.color: theme.colors.negativeBackground
|
||||||
text: invited ? qsTr("Decline invite") : qsTr("Leave")
|
text: invited ? qsTr("Decline invite") : qsTr("Leave")
|
||||||
|
Loading…
Reference in New Issue
Block a user