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 @@ -658,7 +658,10 @@ } shouldEncryptMedia(threadInfo: ThreadInfo): boolean { - return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id); + return ( + threadTypeIsThick(threadInfo.type) || + threadInfoInsideCommunity(threadInfo, commStaffCommunity.id) + ); } sendMultimediaMessage = async ( @@ -886,12 +889,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: { @@ -908,7 +915,7 @@ ? processedMedia.thumbHash : null, }, - keyserverOrThreadID: threadInfo.id, + keyserverOrThreadID: uploadMetadataToKeyserver ? threadInfo.id : null, callbacks: { blobServiceUploadHandler, onProgress: (percent: number) => { @@ -941,7 +948,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 @@ -444,7 +444,10 @@ } shouldEncryptMedia(threadInfo: ThreadInfo): boolean { - return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id); + return ( + threadTypeIsThick(threadInfo.type) || + threadInfoInsideCommunity(threadInfo, commStaffCommunity.id) + ); } async sendMultimediaMessage( @@ -761,7 +764,7 @@ }, }; }, - () => this.uploadFiles(threadInfo.id, newUploads), + () => this.uploadFiles(threadInfo, newUploads), ); return true; } @@ -871,16 +874,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' || @@ -922,8 +926,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') ) { @@ -945,7 +951,7 @@ loop: false, thumbHash, }, - keyserverOrThreadID: threadID, + keyserverOrThreadID: isThickThread ? null : threadID, callbacks, }); } else { @@ -1660,7 +1666,7 @@ }; }); - void this.uploadFiles(threadInfo.id, uploadsToRetry); + void this.uploadFiles(threadInfo, uploadsToRetry); } addReply = (message: string) => {