mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Check validity of link previews on import
This commit is contained in:
@@ -516,19 +516,12 @@ export async function handleDataMessage(
|
||||
};
|
||||
}
|
||||
|
||||
if (!item.image && !item.title) {
|
||||
return null;
|
||||
}
|
||||
// Story link previews don't have to correspond to links in the
|
||||
// message body.
|
||||
if (isStory(message.attributes)) {
|
||||
return item;
|
||||
}
|
||||
if (
|
||||
!urls.includes(item.url) ||
|
||||
!LinkPreview.shouldPreviewHref(item.url)
|
||||
!LinkPreview.isValidLinkPreview(urls, item, {
|
||||
isStory: isStory(message.attributes),
|
||||
})
|
||||
) {
|
||||
return undefined;
|
||||
return null;
|
||||
}
|
||||
|
||||
return item;
|
||||
|
||||
Reference in New Issue
Block a user