Update attachment handling

This commit is contained in:
trevor-signal 2024-12-11 14:56:41 -05:00 committed by GitHub
parent 6f7faf4be8
commit 6c348e2db7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 22 deletions

View file

@ -21,7 +21,7 @@ import type {
} from '../model-types.d';
import * as Errors from '../types/errors';
import {
getAttachmentSignature,
getAttachmentSignatureSafe,
isDownloading,
isDownloaded,
} from '../types/Attachment';
@ -44,16 +44,6 @@ export type MessageAttachmentsDownloadedType = {
sticker?: StickerType;
};
function getAttachmentSignatureSafe(
attachment: AttachmentType
): string | undefined {
try {
return getAttachmentSignature(attachment);
} catch {
return undefined;
}
}
function getLogger(source: AttachmentDownloadSource) {
const verbose = source !== AttachmentDownloadSource.BACKUP_IMPORT;
const log = verbose ? logger : { ...logger, info: () => null };