From d5bcb1ba304d1b26003582a8a7e4dbf23caa47b3 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Wed, 23 Sep 2026 17:14:09 -0500 Subject: [PATCH] Improve attachment filtering at receive and render time Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Co-authored-by: Backport Bot --- ts/components/Lightbox.dom.tsx | 2 +- ts/components/StoryImage.dom.tsx | 2 +- ts/components/conversation/Message.dom.tsx | 8 +- .../media-gallery/MediaGridItem.dom.tsx | 4 +- ts/services/backups/export.preload.ts | 2 +- ts/state/ducks/lightbox.preload.ts | 3 +- ts/state/selectors/message.preload.ts | 28 +- ts/state/smart/PinnedMessagesBar.preload.tsx | 2 +- .../processDataMessage_test.preload.ts | 239 +++++++++++++----- ts/textsecure/MessageReceiver.preload.ts | 8 + ts/textsecure/processDataMessage.preload.ts | 24 +- ts/util/Attachment.std.ts | 52 +++- .../getNotificationDataForMessage.preload.ts | 2 +- ts/util/getStoryDuration.dom.ts | 4 +- ts/util/getStoryReplyText.std.ts | 2 +- ts/util/makeQuote.preload.ts | 2 +- 16 files changed, 284 insertions(+), 100 deletions(-) diff --git a/ts/components/Lightbox.dom.tsx b/ts/components/Lightbox.dom.tsx index 497ce12da1..66288be834 100644 --- a/ts/components/Lightbox.dom.tsx +++ b/ts/components/Lightbox.dom.tsx @@ -161,7 +161,7 @@ export function Lightbox({ const incrementalUrl = attachment?.incrementalUrl; const contentType = attachment?.contentType; - const isAttachmentGIF = isGIF(attachment ? [attachment] : undefined); + const isAttachmentGIF = isGIF(attachment); const isDownloading = attachment && isIncremental(attachment) && diff --git a/ts/components/StoryImage.dom.tsx b/ts/components/StoryImage.dom.tsx index 30e3c240de..0f3f81a771 100644 --- a/ts/components/StoryImage.dom.tsx +++ b/ts/components/StoryImage.dom.tsx @@ -128,7 +128,7 @@ export function StoryImage({ /> ); } else if (!isThumbnail && isSupportedVideo) { - const shouldLoop = isGIF(attachment ? [attachment] : undefined); + const shouldLoop = isGIF(attachment); storyElement = (