Page MenuHomePhabricator

D10907.diff
No OneTemporary

D10907.diff

diff --git a/native/media/encrypted-image.react.js b/native/media/encrypted-image.react.js
--- a/native/media/encrypted-image.react.js
+++ b/native/media/encrypted-image.react.js
@@ -7,7 +7,7 @@
import { connectionSelector } from 'lib/selectors/keyserver-selectors.js';
import { ashoatKeyserverID } from 'lib/utils/validation-utils.js';
-import { decryptBase64, decryptMedia } from './encryption-utils.js';
+import { decryptBase64, fetchAndDecryptMedia } from './encryption-utils.js';
import LoadableImage from './loadable-image.react.js';
import { useSelector } from '../redux/redux-utils.js';
import type { ImageSource } from '../types/react-native.js';
@@ -77,7 +77,7 @@
return;
}
- const { result } = await decryptMedia(blobURI, encryptionKey, {
+ const { result } = await fetchAndDecryptMedia(blobURI, encryptionKey, {
destination: 'data_uri',
});
diff --git a/native/media/encryption-utils.js b/native/media/encryption-utils.js
--- a/native/media/encryption-utils.js
+++ b/native/media/encryption-utils.js
@@ -245,7 +245,7 @@
};
}
-async function decryptMedia(
+async function fetchAndDecryptMedia(
blobURI: string,
encryptionKey: string,
options: {
@@ -407,4 +407,4 @@
return commUtilsModule.base64EncodeBuffer(decryptedData.buffer);
}
-export { encryptMedia, decryptMedia, encryptBase64, decryptBase64 };
+export { encryptMedia, fetchAndDecryptMedia, encryptBase64, decryptBase64 };
diff --git a/native/media/save-media.js b/native/media/save-media.js
--- a/native/media/save-media.js
+++ b/native/media/save-media.js
@@ -29,7 +29,7 @@
} from 'lib/utils/report-utils.js';
import { fetchBlob } from './blob-utils.js';
-import { decryptMedia } from './encryption-utils.js';
+import { fetchAndDecryptMedia } from './encryption-utils.js';
import {
fetchAssetInfo,
fetchFileInfo,
@@ -378,7 +378,7 @@
const steps: Array<MediaMissionStep> = [];
if (encryptionKey) {
const { steps: decryptionSteps, result: decryptionResult } =
- await decryptMedia(inputURI, encryptionKey, {
+ await fetchAndDecryptMedia(inputURI, encryptionKey, {
destination: 'file',
destinationDirectory: directory,
});
diff --git a/native/media/video-playback-modal.react.js b/native/media/video-playback-modal.react.js
--- a/native/media/video-playback-modal.react.js
+++ b/native/media/video-playback-modal.react.js
@@ -19,7 +19,7 @@
import { useIsAppBackgroundedOrInactive } from 'lib/shared/lifecycle-utils.js';
import type { MediaInfo } from 'lib/types/media-types.js';
-import { decryptMedia } from './encryption-utils.js';
+import { fetchAndDecryptMedia } from './encryption-utils.js';
import { formatDuration } from './video-utils.js';
import ConnectedStatusBar from '../connected-status-bar.react.js';
import type { AppNavigationProp } from '../navigation/app-navigator.react.js';
@@ -116,7 +116,7 @@
return;
}
- const { result } = await decryptMedia(blobURI, encryptionKey, {
+ const { result } = await fetchAndDecryptMedia(blobURI, encryptionKey, {
destination: 'file',
});
if (result.success) {
diff --git a/web/media/encrypted-multimedia.react.js b/web/media/encrypted-multimedia.react.js
--- a/web/media/encrypted-multimedia.react.js
+++ b/web/media/encrypted-multimedia.react.js
@@ -7,7 +7,7 @@
import type { EncryptedMediaType } from 'lib/types/media-types.js';
-import { decryptMedia } from './encryption-utils.js';
+import { fetchAndDecryptMedia } from './encryption-utils.js';
import LoadableVideo from './loadable-video.react.js';
import css from './media.css';
import LoadingIndicator from '../loading-indicator.react.js';
@@ -49,7 +49,7 @@
setSource(null);
const loadDecrypted = async () => {
- const { result } = await decryptMedia(blobURI, encryptionKey);
+ const { result } = await fetchAndDecryptMedia(blobURI, encryptionKey);
if (!isMounted) {
return;
}
diff --git a/web/media/encryption-utils.js b/web/media/encryption-utils.js
--- a/web/media/encryption-utils.js
+++ b/web/media/encryption-utils.js
@@ -137,7 +137,7 @@
*
* The returned object URL should be revoked when the media is no longer needed.
*/
-async function decryptMedia(
+async function fetchAndDecryptMedia(
blobURI: string,
encryptionKey: string,
): Promise<{
@@ -251,4 +251,4 @@
return thumbHashToDataURL(thumbhashBytes);
}
-export { encryptFile, decryptMedia, decryptThumbhashToDataURL };
+export { encryptFile, fetchAndDecryptMedia, decryptThumbhashToDataURL };
diff --git a/web/media/loadable-video.react.js b/web/media/loadable-video.react.js
--- a/web/media/loadable-video.react.js
+++ b/web/media/loadable-video.react.js
@@ -3,7 +3,7 @@
import invariant from 'invariant';
import * as React from 'react';
-import { decryptMedia } from './encryption-utils.js';
+import { fetchAndDecryptMedia } from './encryption-utils.js';
import { preloadImage } from './media-utils.js';
import type { CSSStyle } from '../types/styles';
@@ -54,7 +54,7 @@
thumbnailBlobURI && thumbnailEncryptionKey,
'invalid encrypted thumbnail source',
);
- const { result } = await decryptMedia(
+ const { result } = await fetchAndDecryptMedia(
thumbnailBlobURI,
thumbnailEncryptionKey,
);

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 8:36 AM (21 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2450989
Default Alt Text
D10907.diff (5 KB)

Event Timeline