Use new attachments API endpoint
This commit is contained in:
parent
d7bd4eb156
commit
f1624705a7
3 changed files with 51 additions and 29 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue