Page MenuHomePhabricator

D5086.diff
No OneTemporary

D5086.diff

diff --git a/keyserver/src/fetchers/upload-fetchers.js b/keyserver/src/fetchers/upload-fetchers.js
--- a/keyserver/src/fetchers/upload-fetchers.js
+++ b/keyserver/src/fetchers/upload-fetchers.js
@@ -115,10 +115,10 @@
return result.map(mediaFromRow);
}
-async function fetchMediaFromMediaMessageContent(
+async function fetchUploadsForMessage(
viewer: Viewer,
mediaMessageContents: $ReadOnlyArray<MediaMessageServerDBContent>,
-): Promise<$ReadOnlyArray<Media>> {
+): Promise<$ReadOnlyArray<Object>> {
const uploadIDs = [];
for (const mediaContent of mediaMessageContents) {
uploadIDs.push(mediaContent.uploadID);
@@ -135,6 +135,14 @@
`;
const [uploads] = await dbQuery(query);
+ return uploads;
+}
+
+async function fetchMediaFromMediaMessageContent(
+ viewer: Viewer,
+ mediaMessageContents: $ReadOnlyArray<MediaMessageServerDBContent>,
+): Promise<$ReadOnlyArray<Media>> {
+ const uploads = await fetchUploadsForMessage(viewer, mediaMessageContents);
const uploadMap = _keyBy('uploadID')(uploads);
const media: Media[] = [];

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 2:53 PM (14 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2597316
Default Alt Text
D5086.diff (1 KB)

Event Timeline