diff --git a/native/input/input-state-container.react.js b/native/input/input-state-container.react.js --- a/native/input/input-state-container.react.js +++ b/native/input/input-state-container.react.js @@ -643,7 +643,10 @@ } shouldEncryptMedia(threadInfo: ThreadInfo): boolean { - return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id); + return ( + threadTypeIsThick(threadInfo.type) || + threadInfoInsideCommunity(threadInfo, commStaffCommunity.id) + ); } sendMultimediaMessage = async ( @@ -871,12 +874,16 @@ uploadResult, uploadThumbnailResult, mediaMissionResult; + + const isThickThread = threadTypeIsThick(threadInfo.type); + const useBlobService = isThickThread || this.useBlobServiceUploads; try { if ( - this.useBlobServiceUploads && + useBlobService && (processedMedia.mediaType === 'encrypted_photo' || processedMedia.mediaType === 'encrypted_video') ) { + const uploadMetadataToKeyserver = !isThickThread; const uploadPromise = this.props.blobServiceUpload({ uploadInput: { blobInput: { @@ -893,7 +900,7 @@ ? processedMedia.thumbHash : null, }, - keyserverOrThreadID: threadInfo.id, + keyserverOrThreadID: uploadMetadataToKeyserver ? threadInfo.id : null, callbacks: { blobServiceUploadHandler, onProgress: (percent: number) => { @@ -926,7 +933,9 @@ dimensions: processedMedia.dimensions, thumbHash: processedMedia.thumbHash, }, - keyserverOrThreadID: threadInfo.id, + keyserverOrThreadID: uploadMetadataToKeyserver + ? threadInfo.id + : null, callbacks: { blobServiceUploadHandler, }, diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js --- a/web/input/input-state-container.react.js +++ b/web/input/input-state-container.react.js @@ -441,7 +441,10 @@ } shouldEncryptMedia(threadInfo: ThreadInfo): boolean { - return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id); + return ( + threadTypeIsThick(threadInfo.type) || + threadInfoInsideCommunity(threadInfo, commStaffCommunity.id) + ); } async sendMultimediaMessage( @@ -757,7 +760,7 @@ }, }; }, - () => this.uploadFiles(threadInfo.id, newUploads), + () => this.uploadFiles(threadInfo, newUploads), ); return true; } @@ -867,16 +870,17 @@ } uploadFiles( - threadID: string, + threadInfo: ThreadInfo, uploads: $ReadOnlyArray, ): Promise { return Promise.all( - uploads.map(upload => this.uploadFile(threadID, upload)), + uploads.map(upload => this.uploadFile(threadInfo, upload)), ); } - async uploadFile(threadID: string, upload: PendingMultimediaUpload) { + async uploadFile(threadInfo: ThreadInfo, upload: PendingMultimediaUpload) { const { selectTime, localID, encryptionKey } = upload; + const threadID = threadInfo.id; const isEncrypted = !!encryptionKey && (upload.mediaType === 'encrypted_photo' || @@ -918,8 +922,10 @@ abortHandler: (abort: () => void) => this.handleAbortCallback(threadID, localID, abort), }; + const isThickThread = threadTypeIsThick(threadInfo.type); + const useBlobService = isThickThread || this.useBlobServiceUploads; if ( - this.useBlobServiceUploads && + useBlobService && (upload.mediaType === 'encrypted_photo' || upload.mediaType === 'encrypted_video') ) { @@ -941,7 +947,7 @@ loop: false, thumbHash, }, - keyserverOrThreadID: threadID, + keyserverOrThreadID: isThickThread ? null : threadID, callbacks, }); } else { @@ -1645,7 +1651,7 @@ }; }); - void this.uploadFiles(threadInfo.id, uploadsToRetry); + void this.uploadFiles(threadInfo, uploadsToRetry); } addReply = (message: string) => {