Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3366095
D5086.id16640.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.id16640.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
Tue, Nov 26, 9:31 AM (18 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2583315
Default Alt Text
D5086.id16640.diff (1 KB)
Attached To
Mode
D5086: [keyserver] Pull `fetchUploadsForMessage(...)` out of `fetchMediaFromMediaMessageContent(...)`
Attached
Detach File
Event Timeline
Log In to Comment