Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3359685
D7376.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
889 B
Referenced Files
None
Subscribers
None
D7376.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 10:23 AM (21 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576994
Default Alt Text
D7376.diff (889 B)
Attached To
Mode
D7376: [keyserver] Introduce `assignThreadContainerToMedia`
Attached
Detach File
Event Timeline
Log In to Comment