Page MenuHomePhabricator

No OneTemporary

diff --git a/keyserver/src/updaters/upload-updaters.js b/keyserver/src/updaters/upload-updaters.js
index 5c284d4b3..fa54d1778 100644
--- a/keyserver/src/updaters/upload-updaters.js
+++ b/keyserver/src/updaters/upload-updaters.js
@@ -1,41 +1,47 @@
// @flow
import type { MediaMessageServerDBContent } from 'lib/types/messages/media.js';
import { getUploadIDsFromMediaMessageServerDBContents } from 'lib/types/messages/media.js';
import { dbQuery, SQL } from '../database/database.js';
import type { Viewer } from '../session/viewer.js';
async function assignImages(
viewer: Viewer,
mediaIDs: $ReadOnlyArray<string>,
containerID: string,
threadID: string,
): Promise<void> {
const query = SQL`
UPDATE uploads
SET container = ${containerID}, thread = ${threadID}
- WHERE id IN (${mediaIDs}) AND uploader = ${viewer.id}
- AND container IS NULL AND thread IS NULL
+ WHERE id IN (${mediaIDs})
+ AND uploader = ${viewer.id}
+ AND container IS NULL
+ AND user_container IS NULL
+ AND thread IS NULL
`;
await dbQuery(query);
}
async function assignMessageContainerToMedia(
viewer: Viewer,
mediaMessageContents: $ReadOnlyArray<MediaMessageServerDBContent>,
containerID: string,
threadID: string,
): Promise<void> {
const uploadIDs =
getUploadIDsFromMediaMessageServerDBContents(mediaMessageContents);
const query = SQL`
UPDATE uploads
SET container = ${containerID}, thread = ${threadID}
- WHERE id IN (${uploadIDs}) AND uploader = ${viewer.id}
- AND container IS NULL AND thread IS NULL
+ WHERE id IN (${uploadIDs})
+ AND uploader = ${viewer.id}
+ AND container IS NULL
+ AND user_container IS NULL
+ AND thread IS NULL
`;
await dbQuery(query);
}
export { assignImages, assignMessageContainerToMedia };

File Metadata

Mime Type
text/x-diff
Expires
Sat, Nov 23, 2:20 AM (22 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2559371
Default Alt Text
(1 KB)

Event Timeline