From 04d5423b08ced44a5e09a77921b5b315771c76d5 Mon Sep 17 00:00:00 2001 From: Masterjoona <69722179+Masterjoona@users.noreply.github.com> Date: Fri, 22 Mar 2024 01:42:41 +0200 Subject: [PATCH] fix(AnonymiseFileNames): anonymise files in forum posts (#2270) --- src/plugins/anonymiseFileNames/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/anonymiseFileNames/index.tsx b/src/plugins/anonymiseFileNames/index.tsx index 911440230..b424b7a59 100644 --- a/src/plugins/anonymiseFileNames/index.tsx +++ b/src/plugins/anonymiseFileNames/index.tsx @@ -78,6 +78,13 @@ export default definePlugin({ "uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f)),$1(...args)),", }, }, + { + find: "message.attachments", + replacement: { + match: /(\i.uploadFiles\((\i),)/, + replace: "$2.forEach(f=>f.filename=$self.anonymise(f)),$1" + } + }, { find: ".Messages.ATTACHMENT_UTILITIES_SPOILER", replacement: {