summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-20 14:09:19 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-20 14:09:19 +0200
commit88ed0fade74915e83df3a8e335d7cc49ee068d5c (patch)
tree32be533662aae46c0320725d3d9af8a10ef62eda /resources
parentFix reaction button again (diff)
downloadnheko-88ed0fade74915e83df3a8e335d7cc49ee068d5c.tar.xz
Explicitly reload data in delegates, if related events got loaded
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/MessageView.qml2
-rw-r--r--resources/qml/TimelineRow.qml39
-rw-r--r--resources/qml/delegates/MessageDelegate.qml11
-rw-r--r--resources/qml/delegates/Reply.qml2
-rw-r--r--resources/qml/emoji/StickerPicker.qml1
5 files changed, 31 insertions, 24 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index f56af237..564c8dc7 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -341,6 +341,7 @@ ScrollView {
             required property var timestamp
             required property int status
             required property int index
+            required property int relatedEventCacheBuster
             required property string previousMessageUserId
             required property string day
             required property string previousMessageDay
@@ -446,6 +447,7 @@ ScrollView {
                 trustlevel: wrapper.trustlevel
                 timestamp: wrapper.timestamp
                 status: wrapper.status
+                relatedEventCacheBuster: wrapper.relatedEventCacheBuster
                 y: section.visible && section.active ? section.y + section.height : 0
 
                 HoverHandler {
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index 70db08e7..755ab503 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -40,6 +40,7 @@ Item {
     required property int trustlevel
     required property var timestamp
     required property int status
+    required property int relatedEventCacheBuster
 
     anchors.left: parent.left
     anchors.right: parent.right
@@ -90,25 +91,26 @@ Item {
                 }
 
                 visible: replyTo
-                userColor: replyTo, TimelineManager.userColor(userId, Nheko.colors.base)
-                blurhash: replyTo, fromModel(Room.Blurhash) ?? ""
-                body: replyTo, fromModel(Room.Body) ?? ""
-                formattedBody: replyTo, fromModel(Room.FormattedBody) ?? ""
+                userColor: r.relatedEventCacheBuster, TimelineManager.userColor(userId, Nheko.colors.base)
+                blurhash: r.relatedEventCacheBuster, fromModel(Room.Blurhash) ?? ""
+                body: r.relatedEventCacheBuster, fromModel(Room.Body) ?? ""
+                formattedBody: r.relatedEventCacheBuster, fromModel(Room.FormattedBody) ?? ""
                 eventId: fromModel(Room.EventId) ?? ""
-                filename: replyTo, fromModel(Room.Filename) ?? ""
-                filesize: replyTo, fromModel(Room.Filesize) ?? ""
-                proportionalHeight: replyTo, fromModel(Room.ProportionalHeight) ?? 1
-                type: replyTo, fromModel(Room.Type) ?? MtxEvent.UnknownMessage
-                typeString: replyTo, fromModel(Room.TypeString) ?? ""
-                url: replyTo, fromModel(Room.Url) ?? ""
-                originalWidth: replyTo, fromModel(Room.OriginalWidth) ?? 0
-                isOnlyEmoji: replyTo, fromModel(Room.IsOnlyEmoji) ?? false
-                userId: replyTo, fromModel(Room.UserId) ?? ""
-                userName: replyTo, fromModel(Room.UserName) ?? ""
-                thumbnailUrl: replyTo, fromModel(Room.ThumbnailUrl) ?? ""
-                roomTopic: replyTo, fromModel(Room.RoomTopic) ?? ""
-                roomName: replyTo, fromModel(Room.RoomName) ?? ""
-                callType: replyTo, fromModel(Room.CallType) ?? ""
+                filename: r.relatedEventCacheBuster, fromModel(Room.Filename) ?? ""
+                filesize: r.relatedEventCacheBuster, fromModel(Room.Filesize) ?? ""
+                proportionalHeight: r.relatedEventCacheBuster, fromModel(Room.ProportionalHeight) ?? 1
+                type: r.relatedEventCacheBuster, fromModel(Room.Type) ?? MtxEvent.UnknownMessage
+                typeString: r.relatedEventCacheBuster, fromModel(Room.TypeString) ?? ""
+                url: r.relatedEventCacheBuster, fromModel(Room.Url) ?? ""
+                originalWidth: r.relatedEventCacheBuster, fromModel(Room.OriginalWidth) ?? 0
+                isOnlyEmoji: r.relatedEventCacheBuster, fromModel(Room.IsOnlyEmoji) ?? false
+                userId: r.relatedEventCacheBuster, fromModel(Room.UserId) ?? ""
+                userName: r.relatedEventCacheBuster, fromModel(Room.UserName) ?? ""
+                thumbnailUrl: r.relatedEventCacheBuster, fromModel(Room.ThumbnailUrl) ?? ""
+                roomTopic: r.relatedEventCacheBuster, fromModel(Room.RoomTopic) ?? ""
+                roomName: r.relatedEventCacheBuster, fromModel(Room.RoomName) ?? ""
+                callType: r.relatedEventCacheBuster, fromModel(Room.CallType) ?? ""
+                relatedEventCacheBuster: r.relatedEventCacheBuster, fromModel(Room.RelatedEventCacheBuster) ?? 0
             }
 
             // actual message content
@@ -134,6 +136,7 @@ Item {
                 roomTopic: r.roomTopic
                 roomName: r.roomName
                 callType: r.callType
+                relatedEventCacheBuster: r.relatedEventCacheBuster
                 isReply: false
             }
 
diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index 0b060629..c64ae887 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/resources/qml/delegates/MessageDelegate.qml
@@ -29,6 +29,7 @@ Item {
     required property string roomTopic
     required property string roomName
     required property string callType
+    required property int relatedEventCacheBuster
 
     height: chooser.childrenRect.height
 
@@ -301,7 +302,7 @@ Item {
                 body: formatted
                 isOnlyEmoji: false
                 isReply: d.isReply
-                formatted: room.formatPowerLevelEvent(d.eventId)
+                formatted: d.relatedEventCacheBuster, room.formatPowerLevelEvent(d.eventId)
             }
 
         }
@@ -313,7 +314,7 @@ Item {
                 body: formatted
                 isOnlyEmoji: false
                 isReply: d.isReply
-                formatted: room.formatJoinRuleEvent(d.eventId)
+                formatted: d.relatedEventCacheBuster, room.formatJoinRuleEvent(d.eventId)
             }
 
         }
@@ -325,7 +326,7 @@ Item {
                 body: formatted
                 isOnlyEmoji: false
                 isReply: d.isReply
-                formatted: room.formatHistoryVisibilityEvent(d.eventId)
+                formatted: d.relatedEventCacheBuster, room.formatHistoryVisibilityEvent(d.eventId)
             }
 
         }
@@ -337,7 +338,7 @@ Item {
                 body: formatted
                 isOnlyEmoji: false
                 isReply: d.isReply
-                formatted: room.formatGuestAccessEvent(d.eventId)
+                formatted: d.relatedEventCacheBuster, room.formatGuestAccessEvent(d.eventId)
             }
 
         }
@@ -349,7 +350,7 @@ Item {
                 body: formatted
                 isOnlyEmoji: false
                 isReply: d.isReply
-                formatted: room.formatMemberEvent(d.eventId)
+                formatted: d.relatedEventCacheBuster, room.formatMemberEvent(d.eventId)
             }
 
         }
diff --git a/resources/qml/delegates/Reply.qml b/resources/qml/delegates/Reply.qml
index 3a188d78..75e3d617 100644
--- a/resources/qml/delegates/Reply.qml
+++ b/resources/qml/delegates/Reply.qml
@@ -30,6 +30,7 @@ Item {
     property string roomTopic
     property string roomName
     property string callType
+    property int relatedEventCacheBuster
 
     width: parent.width
     height: replyContainer.height
@@ -95,6 +96,7 @@ Item {
             roomTopic: r.roomTopic
             roomName: r.roomName
             callType: r.callType
+            relatedEventCacheBuster: r.relatedEventCacheBuster
             enabled: false
             width: parent.width
             isReply: true
diff --git a/resources/qml/emoji/StickerPicker.qml b/resources/qml/emoji/StickerPicker.qml
index 813c0b12..3731a948 100644
--- a/resources/qml/emoji/StickerPicker.qml
+++ b/resources/qml/emoji/StickerPicker.qml
@@ -122,7 +122,6 @@ Menu {
                 id: gridView
 
                 model: roomid ? TimelineManager.completerFor("stickers", roomid) : null
-
                 Layout.preferredHeight: cellHeight * 3.5
                 Layout.preferredWidth: stickersPerRow * stickerDimPad + 20
                 Layout.leftMargin: 4