From 4f2f872bf993313694701981e7d01b3d22fe671b Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 22 Oct 2025 15:15:19 -0400 Subject: [PATCH] fix: update logic re: federating out topic moves --- src/activitypub/out.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/activitypub/out.js b/src/activitypub/out.js index 014531c310..40d597db51 100644 --- a/src/activitypub/out.js +++ b/src/activitypub/out.js @@ -373,8 +373,10 @@ Out.move.context = enabledCheck(async (uid, tid) => { const { cid, oldCid } = await topics.getTopicFields(tid, ['cid', 'oldCid']); // This check may be revised if inter-community moderation becomes real. - const isNotLocal = id => !utils.isNumber(id) || parseInt(id, 10) < 1; - if ([cid, oldCid].some(isNotLocal)) { + const isLocal = id => utils.isNumber(id) && parseInt(id, 10) > 0; + if (isLocal(oldCid) && !isLocal(cid)) { // moving to remote/uncategorized + return Out.remove.context(uid, tid); + } else if ((isLocal(cid) && !isLocal(oldCid)) || [cid, oldCid].every(!isLocal)) { // stealing or remote-to-remote return; }