From ef3f3d0af5518794e805bdeab7c45b9cae661776 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 28 Oct 2020 14:11:40 +1100 Subject: [PATCH] enable back link previews in sent message --- ts/components/session/conversation/SessionCompositionBox.tsx | 3 ++- ts/receiver/queuedJob.ts | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ts/components/session/conversation/SessionCompositionBox.tsx b/ts/components/session/conversation/SessionCompositionBox.tsx index c54a85729..f6b738c05 100644 --- a/ts/components/session/conversation/SessionCompositionBox.tsx +++ b/ts/components/session/conversation/SessionCompositionBox.tsx @@ -485,6 +485,7 @@ export class SessionCompositionBox extends React.Component { return; } const { quotedMessageProps } = this.props; + const { stagedLinkPreview } = this.state; // Send message this.props.onMessageSending(); @@ -502,7 +503,7 @@ export class SessionCompositionBox extends React.Component { messagePlaintext, attachments, extractedQuotedMessageProps, - undefined, + [_.pick(stagedLinkPreview, 'url', 'image', 'title')], null, {} ); diff --git a/ts/receiver/queuedJob.ts b/ts/receiver/queuedJob.ts index 48026b6fd..200869195 100644 --- a/ts/receiver/queuedJob.ts +++ b/ts/receiver/queuedJob.ts @@ -247,10 +247,7 @@ function handleLinkPreviews( const urls = window.Signal.LinkPreviews.findLinks(messageBody); const incomingPreview = messagePreview || []; const preview = incomingPreview.filter( - (item: any) => - (item.image || item.title) && - urls.includes(item.url) && - window.Signal.LinkPreviews.isLinkInWhitelist(item.url) + (item: any) => (item.image || item.title) && urls.includes(item.url) ); if (preview.length < incomingPreview.length) { window.log.info(