Content scanner also checks for thumbnails (#5911)

* scan also thumbnails for medias

* pr suggestion
This commit is contained in:
Mauro
2026-07-22 16:43:08 +02:00
committed by GitHub
parent cff46137b9
commit 6967f99626
12 changed files with 155 additions and 17 deletions
@@ -25,6 +25,7 @@ struct TimelineReplyView: View {
var body: some View {
ContentScanningView(contentScannerService: timelineContext?.contentScannerService,
mediaSource: scannedMediaSource,
thumbnailSource: scannedThumbnailSource,
containerShowsFailure: false) {
content
.roundedContainer(padding: 4,
@@ -63,6 +64,21 @@ struct TimelineReplyView: View {
}
}
/// The thumbnail source validated alongside ``scannedMediaSource`` when the replied to message has one.
private var scannedThumbnailSource: MediaSourceProxy? {
guard case .loaded(_, _, let eventContent) = timelineItemReplyDetails,
case .message(let message) = eventContent else {
return nil
}
switch message {
case .file(let content): return content.thumbnailSource
case .image(let content): return content.thumbnailInfo?.source
case .video(let content): return content.thumbnailInfo?.source
default: return nil
}
}
@ViewBuilder
private var content: some View {
if let timelineItemReplyDetails {