Page MenuHomePhabricator

D5086.id16636.diff
No OneTemporary

D5086.id16636.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
Tue, Nov 26, 8:49 AM (18 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2583315
Default Alt Text
D5086.id16636.diff (1 KB)

Event Timeline