summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-12 22:28:01 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-12 22:28:01 +0200
commit9d6bc706ff1a4fd035516ab04d3f762325dfff83 (patch)
tree15b4dabe50453ea3034abc5f19d726eff3efa409 /resources
parentFix a few missing properties (diff)
downloadnheko-9d6bc706ff1a4fd035516ab04d3f762325dfff83.tar.xz
Don't use full dump for replies
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/TimelineRow.qml42
1 files changed, 22 insertions, 20 deletions
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml

index 53453e99..58e367a0 100644 --- a/resources/qml/TimelineRow.qml +++ b/resources/qml/TimelineRow.qml
@@ -71,8 +71,6 @@ Item { RowLayout { id: row - property var replyData: chat.model.getDump(replyTo, eventId) - anchors.rightMargin: 1 anchors.leftMargin: Nheko.avatarSize + 16 anchors.left: parent.left @@ -87,26 +85,30 @@ Item { // fancy reply, if this is a reply Reply { + function fromModel(role) { + return replyTo != "" ? room.dataById(replyTo, role) : null; + } + visible: replyTo userColor: TimelineManager.userColor(userId, Nheko.colors.base) - blurhash: row.replyData.blurhash ?? "" - body: row.replyData.body ?? "" - formattedBody: row.replyData.formattedBody ?? "" - eventId: row.replyData.eventId ?? "" - filename: row.replyData.filename ?? "" - filesize: row.replyData.filesize ?? "" - proportionalHeight: row.replyData.proportionalHeight ?? 1 - type: row.replyData.type ?? MtxEvent.UnknownMessage - typeString: row.replyData.typeString ?? "" - url: row.replyData.url ?? "" - originalWidth: row.replyData.originalWidth ?? 0 - isOnlyEmoji: row.replyData.isOnlyEmoji ?? false - userId: row.replyData.userId ?? "" - userName: row.replyData.userName ?? "" - thumbnailUrl: row.replyData.thumbnailUrl ?? "" - roomTopic: row.replyData.roomTopic ?? "" - roomName: row.replyData.roomName ?? "" - callType: row.replyData.callType ?? "" + blurhash: fromModel(Room.Blurhash) ?? "" + body: fromModel(Room.Body) ?? "" + formattedBody: fromModel(Room.FormattedBody) ?? "" + eventId: fromModel(Room.EventId) ?? "" + filename: fromModel(Room.Filename) ?? "" + filesize: fromModel(Room.Filesize) ?? "" + proportionalHeight: fromModel(Room.ProportionalHeight) ?? 1 + type: fromModel(Room.Type) ?? MtxEvent.UnknownMessage + typeString: fromModel(Room.TypeString) ?? "" + url: fromModel(Room.Url) ?? "" + originalWidth: fromModel(Room.OriginalWidth) ?? 0 + isOnlyEmoji: fromModel(Room.IsOnlyEmoji) ?? false + userId: fromModel(Room.UserId) ?? "" + userName: fromModel(Room.UserName) ?? "" + thumbnailUrl: fromModel(Room.ThumbnailUrl) ?? "" + roomTopic: fromModel(Room.RoomTopic) ?? "" + roomName: fromModel(Room.RoomName) ?? "" + callType: fromModel(Room.CallType) ?? "" } // actual message content