Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3378629
D6482.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
D6482.diff
View Options
diff --git a/keyserver/src/responders/message-responders.js b/keyserver/src/responders/message-responders.js
--- a/keyserver/src/responders/message-responders.js
+++ b/keyserver/src/responders/message-responders.js
@@ -189,12 +189,13 @@
);
if (request.mediaIDs) {
- await assignMedia(viewer, request.mediaIDs, id);
+ await assignMedia(viewer, request.mediaIDs, id, threadID);
} else {
await assignMessageContainerToMedia(
viewer,
request.mediaMessageContents,
id,
+ threadID,
);
}
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
@@ -10,11 +10,13 @@
viewer: Viewer,
mediaIDs: $ReadOnlyArray<string>,
containerID: string,
+ threadID: string,
): Promise<void> {
const query = SQL`
UPDATE uploads
- SET container = ${containerID}
- WHERE id IN (${mediaIDs}) AND uploader = ${viewer.id} AND container IS NULL
+ SET container = ${containerID}, thread = ${threadID}
+ WHERE id IN (${mediaIDs}) AND uploader = ${viewer.id}
+ AND container IS NULL AND thread IS NULL
`;
await dbQuery(query);
}
@@ -23,13 +25,15 @@
viewer: Viewer,
mediaMessageContents: $ReadOnlyArray<MediaMessageServerDBContent>,
containerID: string,
+ threadID: string,
): Promise<void> {
const uploadIDs =
getUploadIDsFromMediaMessageServerDBContents(mediaMessageContents);
const query = SQL`
UPDATE uploads
- SET container = ${containerID}
- WHERE id IN (${uploadIDs}) AND uploader = ${viewer.id} AND container IS NULL
+ SET container = ${containerID}, thread = ${threadID}
+ WHERE id IN (${uploadIDs}) AND uploader = ${viewer.id}
+ AND container IS NULL AND thread IS NULL
`;
await dbQuery(query);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 12:00 PM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2593927
Default Alt Text
D6482.diff (1 KB)
Attached To
Mode
D6482: [keyserver] Attach a threadID to each media (image/video) upload
Attached
Detach File
Event Timeline
Log In to Comment