mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Fix attachment downloads for zero cdnId
This commit is contained in:
@@ -43,10 +43,14 @@ export function processAttachment(
|
||||
if (!attachment) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { cdnId } = attachment;
|
||||
const hasCdnId = cdnId instanceof Long ? !cdnId.isZero() : Boolean(cdnId);
|
||||
|
||||
return {
|
||||
...shallowDropNull(attachment),
|
||||
|
||||
cdnId: attachment.cdnId ? attachment.cdnId.toString() : undefined,
|
||||
cdnId: hasCdnId ? String(cdnId) : undefined,
|
||||
key: attachment.key ? Bytes.toBase64(attachment.key) : undefined,
|
||||
digest: attachment.digest ? Bytes.toBase64(attachment.digest) : undefined,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user