Update attachment handling
This commit is contained in:
parent
6f7faf4be8
commit
6c348e2db7
4 changed files with 34 additions and 22 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue