Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32871907
D7292.1768139928.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7292.1768139928.diff
View Options
diff --git a/web/chat/chat-input-bar.react.js b/web/chat/chat-input-bar.react.js
--- a/web/chat/chat-input-bar.react.js
+++ b/web/chat/chat-input-bar.react.js
@@ -231,19 +231,38 @@
}
const { pendingUploads, cancelPendingUpload } = this.props.inputState;
- const multimediaPreviews = pendingUploads.map(pendingUpload => (
- <Multimedia
- mediaSource={{
+ const multimediaPreviews = pendingUploads.map(pendingUpload => {
+ let mediaSource;
+ if (
+ pendingUpload.mediaType === 'encrypted_photo' ||
+ pendingUpload.mediaType === 'encrypted_video'
+ ) {
+ invariant(
+ pendingUpload.encryptionKey,
+ 'encryptionKey should be set for encrypted media',
+ );
+ mediaSource = {
+ type: pendingUpload.mediaType,
+ holder: pendingUpload.uri,
+ encryptionKey: pendingUpload.encryptionKey,
+ };
+ } else {
+ mediaSource = {
type: pendingUpload.mediaType,
uri: pendingUpload.uri,
- }}
- pendingUpload={pendingUpload}
- remove={cancelPendingUpload}
- multimediaCSSClass={css.multimedia}
- multimediaImageCSSClass={css.multimediaImage}
- key={pendingUpload.localID}
- />
- ));
+ };
+ }
+ return (
+ <Multimedia
+ mediaSource={mediaSource}
+ pendingUpload={pendingUpload}
+ remove={cancelPendingUpload}
+ multimediaCSSClass={css.multimedia}
+ multimediaImageCSSClass={css.multimediaImage}
+ key={pendingUpload.localID}
+ />
+ );
+ });
const previews =
multimediaPreviews.length > 0 ? (
<div className={css.previews}>{multimediaPreviews}</div>
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
@@ -693,6 +693,7 @@
uri,
loop: false,
uriIsReal: false,
+ encryptionKey: null,
progressPercent: 0,
abort: null,
steps,
diff --git a/web/input/input-state.js b/web/input/input-state.js
--- a/web/input/input-state.js
+++ b/web/input/input-state.js
@@ -4,6 +4,7 @@
import {
type MediaType,
+ type EncryptedMediaType,
type Dimensions,
type MediaMissionStep,
} from 'lib/types/media-types.js';
@@ -19,9 +20,10 @@
// This is set to true if the upload fails for whatever reason
failed: boolean,
file: File,
- mediaType: MediaType,
+ mediaType: MediaType | EncryptedMediaType,
dimensions: ?Dimensions,
uri: string,
+ encryptionKey: ?string,
loop: boolean,
// URLs created with createObjectURL aren't considered "real". The distinction
// is required because those "fake" URLs must be disposed properly
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 11, 1:58 PM (1 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5919220
Default Alt Text
D7292.1768139928.diff (2 KB)
Attached To
Mode
D7292: [web] Add encryptionKey to PendingMultimediaUpload
Attached
Detach File
Event Timeline
Log In to Comment