mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Use new attachments API endpoint
This commit is contained in:
committed by
Josh Perez
parent
d7bd4eb156
commit
f1624705a7
@@ -1,8 +1,6 @@
|
||||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import Long from 'long';
|
||||
|
||||
import type {
|
||||
AttachmentWithHydratedData,
|
||||
UploadedAttachmentType,
|
||||
@@ -20,12 +18,11 @@ export async function uploadAttachment(
|
||||
const { server } = window.textsecure;
|
||||
strictAssert(server, 'WebAPI must be initialized');
|
||||
|
||||
const attachmentIdString = await server.putEncryptedAttachment(
|
||||
encrypted.ciphertext
|
||||
);
|
||||
const cdnKey = await server.putEncryptedAttachment(encrypted.ciphertext);
|
||||
|
||||
return {
|
||||
cdnId: Long.fromString(attachmentIdString),
|
||||
cdnKey,
|
||||
cdnNumber: 2,
|
||||
key: keys,
|
||||
size: attachment.data.byteLength,
|
||||
digest: encrypted.digest,
|
||||
|
||||
Reference in New Issue
Block a user