Page MenuHomePhabricator

D6485.id21699.diff
No OneTemporary

D6485.id21699.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
@@ -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

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)

Event Timeline