TempInfo Messageeventmodel

Further improvements to the handling of `mediaInfo` in `messageeventmodel`.

`blurhash` and `thumbnailInfo` are now replaced with a single `tempInfo` object that contains a single temp source. The priority is thumbnail > `blurhash` > empty if none exist.

Fixes network/neochat#235
This commit is contained in:
James Graham
2023-05-08 07:50:20 +00:00
committed by Tobias Fella
parent 20443ba59f
commit b82d3ab5ad
4 changed files with 29 additions and 12 deletions

View File

@@ -20,7 +20,7 @@ Components.AlbumMaximizeComponent {
Components.AlbumModelItem {
type: root.modelData.delegateType === MessageEventModel.Image || root.modelData.delegateType === MessageEventModel.Sticker ? Components.AlbumModelItem.Image : Components.AlbumModelItem.Video
source: root.modelData.delegateType === MessageEventModel.Video ? modelData.progressInfo.localPath : modelData.mediaInfo.source
tempSource: modelData.mediaInfo.blurhash
tempSource: modelData.mediaInfo.tempInfo.source
caption: modelData.display
}
]

View File

@@ -74,7 +74,7 @@ TimelineContainer {
Image {
anchors.fill: parent
source: model.mediaInfo.blurhash
source: model.mediaInfo.tempInfo.source
visible: parent.status !== Image.Ready
}

View File

@@ -154,7 +154,7 @@ TimelineContainer {
anchors.fill: parent
visible: false
source: model.mediaInfo.thumbnailInfo.source
source: model.mediaInfo.tempInfo.source
fillMode: Image.PreserveAspectFit
}