Link previews: show full size image less often

This commit is contained in:
Evan Hahn
2021-01-08 13:39:32 -06:00
committed by Scott Nonnenberg
parent 92a35649da
commit 8c25ffd6f5
7 changed files with 220 additions and 53 deletions
+5 -5
View File
@@ -133,12 +133,12 @@ export function isImage(
}
export function isImageAttachment(
attachment: AttachmentType
): boolean | undefined {
return (
attachment?: AttachmentType
): attachment is AttachmentType {
return Boolean(
attachment &&
attachment.contentType &&
isImageTypeSupported(attachment.contentType)
attachment.contentType &&
isImageTypeSupported(attachment.contentType)
);
}
export function hasImage(
+14
View File
@@ -0,0 +1,14 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { AttachmentType } from '../Attachment';
export interface LinkPreviewType {
title: string;
description?: string;
domain: string;
url: string;
isStickerPack: boolean;
image?: AttachmentType;
date?: number;
}