Page MenuHomePhabricator

D7376.id24920.diff
No OneTemporary

D7376.id24920.diff

diff --git a/keyserver/src/updaters/upload-updaters.js b/keyserver/src/updaters/upload-updaters.js
--- a/keyserver/src/updaters/upload-updaters.js
+++ b/keyserver/src/updaters/upload-updaters.js
@@ -52,8 +52,27 @@
await dbQuery(query);
}
+// NOTE: We AREN'T setting the `thread` column for this `uploads` entry
+// because we don't want this upload to be included in the
+// result set of `fetchMediaForThread`.
+async function assignThreadContainerToMedia(
+ viewer: Viewer,
+ mediaID: string,
+ threadID: string,
+): Promise<void> {
+ const query = SQL`
+ UPDATE uploads
+ SET container = ${threadID}
+ WHERE id = ${mediaID}
+ AND uploader = ${viewer.id}
+ AND container IS NULL
+ `;
+ await dbQuery(query);
+}
+
export {
assignImages,
assignMessageContainerToMedia,
assignUserContainerToMedia,
+ assignThreadContainerToMedia,
};

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 12:48 PM (21 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576994
Default Alt Text
D7376.id24920.diff (889 B)

Event Timeline