From e334490cf4f78b0bd31c76f3f9860486a6227ca8 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Fri, 27 Jan 2023 10:39:38 -0500 Subject: [PATCH] Fixes link preview send in stories --- ts/util/sendStoryMessage.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/ts/util/sendStoryMessage.ts b/ts/util/sendStoryMessage.ts index df852a52a..5168a510f 100644 --- a/ts/util/sendStoryMessage.ts +++ b/ts/util/sendStoryMessage.ts @@ -29,20 +29,6 @@ import { collect } from './iterables'; import { DurationInSeconds } from './durations'; import { sanitizeLinkPreview } from '../services/LinkPreview'; -function cleanLinkPreviewIfAny(attachment: AttachmentType): AttachmentType { - if (!attachment.textAttachment || !attachment.textAttachment.preview) { - return attachment; - } - - return { - ...attachment, - textAttachment: { - ...attachment.textAttachment, - preview: undefined, - }, - }; -} - export async function sendStoryMessage( listIds: Array, conversationIds: Array, @@ -153,8 +139,7 @@ export async function sendStoryMessage( sendStateByListId.set(distributionList.id, sendStateByConversationId); }); - const cleanedAttachment = cleanLinkPreviewIfAny(attachment); - const attachments: Array = [cleanedAttachment]; + const attachments: Array = [attachment]; const linkPreview = attachment?.textAttachment?.preview; const sanitizedLinkPreview = linkPreview