Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351314
D8257.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D8257.diff
View Options
diff --git a/keyserver/src/uploads/uploads.js b/keyserver/src/uploads/uploads.js
--- a/keyserver/src/uploads/uploads.js
+++ b/keyserver/src/uploads/uploads.js
@@ -9,7 +9,9 @@
import {
type UploadMediaMetadataRequest,
type UploadMultimediaResult,
+ type UploadMediaMetadataResult,
uploadMultimediaResultValidator,
+ uploadMediaMetadataResultValidator,
type UploadDeletionRequest,
type Dimensions,
} from 'lib/types/media-types.js';
@@ -126,7 +128,7 @@
async function uploadMediaMetadataResponder(
viewer: Viewer,
input: mixed,
-): Promise<UploadMultimediaResult> {
+): Promise<UploadMediaMetadataResult> {
const request = await validateInput(
viewer,
uploadMediaMetadataInputValidator,
@@ -159,10 +161,15 @@
thumbHash: request.thumbHash,
};
- const [result] = await createUploads(viewer, [uploadInfo]);
+ const [creationResult] = await createUploads(viewer, [uploadInfo]);
+ const result: UploadMediaMetadataResult = {
+ ...creationResult,
+ blobHolder,
+ blobHash,
+ };
return validateOutput(
viewer.platformDetails,
- uploadMultimediaResultValidator,
+ uploadMediaMetadataResultValidator,
result,
);
}
diff --git a/lib/actions/upload-actions.js b/lib/actions/upload-actions.js
--- a/lib/actions/upload-actions.js
+++ b/lib/actions/upload-actions.js
@@ -5,6 +5,7 @@
UploadMediaMetadataRequest,
UploadMultimediaResult,
Dimensions,
+ UploadMediaMetadataResult,
} from '../types/media-types';
import type { CallServerEndpoint } from '../utils/call-server-endpoint.js';
import type { UploadBlob } from '../utils/upload-blob.js';
@@ -24,7 +25,9 @@
const uploadMediaMetadata =
(
callServerEndpoint: CallServerEndpoint,
- ): ((input: UploadMediaMetadataRequest) => Promise<UploadMultimediaResult>) =>
+ ): ((
+ input: UploadMediaMetadataRequest,
+ ) => Promise<UploadMediaMetadataResult>) =>
async input => {
const response = await callServerEndpoint('upload_media_metadata', input);
return {
@@ -33,6 +36,8 @@
mediaType: response.mediaType,
dimensions: response.dimensions,
loop: response.loop,
+ blobHolder: response.blobHolder,
+ blobHash: response.blobHash,
};
};
diff --git a/lib/types/media-types.js b/lib/types/media-types.js
--- a/lib/types/media-types.js
+++ b/lib/types/media-types.js
@@ -74,6 +74,18 @@
loop: t.Boolean,
});
+export type UploadMediaMetadataResult = {
+ ...UploadMultimediaResult,
+ +blobHolder: string,
+ +blobHash: string,
+};
+export const uploadMediaMetadataResultValidator: TInterface<UploadMediaMetadataResult> =
+ tShape<UploadMediaMetadataResult>({
+ ...uploadMultimediaResultValidator.meta.props,
+ blobHolder: t.String,
+ blobHash: t.String,
+ });
+
export type UpdateMultimediaMessageMediaPayload = {
+messageID: string,
+currentMediaID: string,
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
@@ -53,6 +53,7 @@
import type {
Dimensions,
UploadMultimediaResult,
+ UploadMediaMetadataResult,
Media,
NativeMediaSelection,
MediaMissionResult,
@@ -150,7 +151,7 @@
) => Promise<UploadMultimediaResult>,
+uploadMediaMetadata: (
input: UploadMediaMetadataRequest,
- ) => Promise<UploadMultimediaResult>,
+ ) => Promise<UploadMediaMetadataResult>,
+sendMultimediaMessage: (
threadID: string,
localID: string,
@@ -1174,7 +1175,7 @@
+thumbHash: ?string,
},
options?: ?CallServerEndpointOptions,
- ): Promise<void> {
+ ): Promise<UploadMediaMetadataResult> {
const newHolder = uuid.v4();
const blobHash = toBase64URL(input.blobHash);
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
@@ -57,6 +57,7 @@
import type {
UploadMultimediaResult,
UploadMediaMetadataRequest,
+ UploadMediaMetadataResult,
MediaMissionStep,
MediaMissionFailure,
MediaMissionResult,
@@ -140,7 +141,7 @@
) => Promise<UploadMultimediaResult>,
+uploadMediaMetadata: (
input: UploadMediaMetadataRequest,
- ) => Promise<UploadMultimediaResult>,
+ ) => Promise<UploadMediaMetadataResult>,
+deleteUpload: (id: string) => Promise<void>,
+sendMultimediaMessage: (
threadID: string,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 12:57 AM (21 h, 12 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573338
Default Alt Text
D8257.diff (4 KB)
Attached To
Mode
D8257: [keyserver] Return blob hash and holder from upload endpoint
Attached
Detach File
Event Timeline
Log In to Comment