From 49a64dc7a790f755fa026619263b15b85236faec Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 16 Apr 2024 14:17:47 -0400 Subject: [PATCH] fix: if the topic already existed in -1, move it to another category if one was passed in options --- src/activitypub/notes.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index 9a2196e39a..6006a374ba 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -63,6 +63,11 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => { let title; if (hasTid) { ({ cid, mainPid } = await topics.getTopicFields(tid, ['tid', 'cid', 'mainPid'])); + + if (options.cid && cid === -1) { + // Move topic + await topics.tools.move(tid, { cid: options.cid, uid: 0 }); + } } else { // mainPid ok to leave as-is cid = options.cid || -1;