Generate mediaName for backed-up attachments

This commit is contained in:
trevor-signal 2024-03-06 13:15:10 -05:00 committed by GitHub
parent db623d13b2
commit cf381cd46c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 171 additions and 2 deletions

View file

@ -28,7 +28,7 @@ import type { ProcessedAttachment } from './Types.d';
import type { WebAPIType } from './WebAPI';
import { createName, getRelativePath } from '../windows/attachments';
function getCdn(attachment: ProcessedAttachment) {
export function getCdn(attachment: ProcessedAttachment): string {
const { cdnId, cdnKey } = attachment;
const cdn = cdnId || cdnKey;
strictAssert(cdn, 'Attachment was missing cdnId or cdnKey');