Page MenuHomePhabricator

D5086.id16532.diff
No OneTemporary

D5086.id16532.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(uploads, 'uploadID');
const media: Media[] = [];

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 10:02 AM (19 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2584224
Default Alt Text
D5086.id16532.diff (1 KB)

Event Timeline