Use v4/attachments endpoint for attachment upload forms

This commit is contained in:
trevor-signal 2024-07-16 16:25:43 -04:00 committed by GitHub
parent 826b361757
commit 451ee56c92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 19 deletions

View file

@ -11,7 +11,7 @@ import { strictAssert } from './assert';
import { backupsService } from '../services/backups';
import { tusUpload } from './uploads/tusProtocol';
import { defaultFileReader } from './uploads/uploads';
import type { AttachmentV3ResponseType } from '../textsecure/WebAPI';
import type { AttachmentUploadFormResponseType } from '../textsecure/WebAPI';
import {
type EncryptedAttachmentV2,
encryptAttachmentV2ToDisk,
@ -79,7 +79,7 @@ export async function encryptAndUploadAttachment({
const { server } = window.textsecure;
strictAssert(server, 'WebAPI must be initialized');
let uploadForm: AttachmentV3ResponseType;
let uploadForm: AttachmentUploadFormResponseType;
let absoluteCiphertextPath: string | undefined;
try {
@ -129,7 +129,7 @@ export async function uploadFile({
}: {
absoluteCiphertextPath: string;
ciphertextFileSize: number;
uploadForm: AttachmentV3ResponseType;
uploadForm: AttachmentUploadFormResponseType;
}): Promise<void> {
const { server } = window.textsecure;
strictAssert(server, 'WebAPI must be initialized');