Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3356819
D6485.id21699.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1000 B
Referenced Files
None
Subscribers
None
D6485.id21699.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
@@ -116,6 +116,20 @@
return result.map(mediaFromRow);
}
+async function fetchMediaForThread(
+ threadID: string,
+): Promise<$ReadOnlyArray<Media>> {
+ const query = SQL`
+ SELECT id AS uploadID, secret AS uploadSecret,
+ type AS uploadType, extra AS uploadExtra
+ FROM uploads
+ WHERE thread = ${threadID} AND filename NOT LIKE 'thumb%'
+ ORDER BY creation_time DESC
+ `;
+ const [uploads] = await dbQuery(query);
+ return uploads.map(mediaFromRow);
+}
+
async function fetchUploadsForMessage(
viewer: Viewer,
mediaMessageContents: $ReadOnlyArray<MediaMessageServerDBContent>,
@@ -204,6 +218,7 @@
getUploadURL,
mediaFromRow,
fetchMedia,
+ fetchMediaForThread,
fetchMediaFromMediaMessageContent,
constructMediaFromMediaMessageContentsAndUploadRows,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 8:53 PM (21 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577289
Default Alt Text
D6485.id21699.diff (1000 B)
Attached To
Mode
D6485: [keyserver] Create a function to query for all uploads from a provided threadID
Attached
Detach File
Event Timeline
Log In to Comment