summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-06-10 00:49:49 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-06-10 00:54:08 +0200
commit0dbc9444c3d43202db2db90e9bfae54811119a0c (patch)
tree429e012d41ab536974023285077d0c3c427c39fe /resources
parentProperly set pack avatar (diff)
downloadnheko-0dbc9444c3d43202db2db90e9bfae54811119a0c.tar.xz
Add inviter to the invite reason
fixes #622
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/TimelineView.qml25
1 files changed, 24 insertions, 1 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 24489d0b..18085f28 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -283,6 +283,29 @@ Item {
 
             onClicked: TimelineManager.openLeaveRoomDialog(room.roomId)
         }
+        RowLayout {
+            Layout.alignment: Qt.AlignHCenter
+            spacing: Nheko.paddingMedium
+            visible: roomPreview && roomPreview.isInvite && reasonField.showReason
+
+            MatrixText {
+                text: qsTr("Invited by %1 (%2)").arg(TimelineManager.escapeEmoji(inviterAvatar.displayName)).arg(TimelineManager.escapeEmoji(TimelineManager.htmlEscape(inviterAvatar.userid)))
+            }
+            Avatar {
+                id: inviterAvatar
+
+                Layout.alignment: Qt.AlignHCenter
+                displayName: roomPreview?.inviterDisplayName ?? ""
+                enabled: true
+                height: 48
+                roomid: preview.roomId
+                url: (roomPreview?.inviterAvatarUrl ?? "").replace("mxc://", "image://MxcImage/")
+                userid: roomPreview?.inviterUserId ?? ""
+                width: 48
+
+                onClicked: TimelineManager.openGlobalUserProfile(roomPreview.inviterUserId)
+            }
+        }
         ScrollView {
             id: reasonField
 
@@ -312,7 +335,7 @@ Item {
             Layout.leftMargin: Nheko.paddingLarge
             Layout.rightMargin: Nheko.paddingLarge
             text: reasonField.showReason ? qsTr("Hide invite reason") : qsTr("Show invite reason")
-            visible: preview.reason !== ""
+            visible: roomPreview && roomPreview.isInvite
 
             onClicked: {
                 reasonField.showReason = !reasonField.showReason;