From 389c531b2cbe8fafb5535cf4722512d4a99573f3 Mon Sep 17 00:00:00 2001 From: Kaity A Date: Tue, 2 May 2023 18:22:42 +1000 Subject: [PATCH] update file sensitivity on note edit --- packages/backend/src/remote/activitypub/models/note.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/backend/src/remote/activitypub/models/note.ts b/packages/backend/src/remote/activitypub/models/note.ts index f699497d50..7b41de6700 100644 --- a/packages/backend/src/remote/activitypub/models/note.ts +++ b/packages/backend/src/remote/activitypub/models/note.ts @@ -589,6 +589,12 @@ export async function updateNote(value: string | IObject, resolver?: Resolver) { update.comment = altText; } + // Don't unmark previously marked sensitive files, + // but if edited post contains sensitive marker, update it. + if (post.sensitive && !file.isSensitive) { + update.isSensitive = post.sensitive; + } + if (notEmpty(update)) { await DriveFiles.update(file.id, update); publishing = true;