Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3356832
D6482.id22418.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.id22418.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
@@ -182,12 +182,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,14 +25,16 @@
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
Sun, Nov 24, 8:59 PM (19 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577301
Default Alt Text
D6482.id22418.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