Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3383329
D5086.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5086.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5086: [keyserver] Pull `fetchUploadsForMessage(...)` out of `fetchMediaFromMediaMessageContent(...)`
Attached
Detach File
Event Timeline
Log In to Comment