fix: rename activitypub.out.announce.category, federate out Delete on topic move to cid -1

This commit is contained in:
Julian Lam
2025-11-06 11:59:56 -05:00
parent e6911be35d
commit 9bb8a955cf
3 changed files with 6 additions and 5 deletions

View File

@@ -267,7 +267,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
if (!hasTid && options.cid) {
// New topic, have category announce it
activitypub.out.announce.category(tid);
activitypub.out.announce.topic(tid);
}
return { tid, count };

View File

@@ -279,7 +279,7 @@ Out.like.note = enabledCheck(async (uid, pid) => {
Out.announce = {};
Out.announce.category = enabledCheck(async (tid) => {
Out.announce.topic = enabledCheck(async (tid) => {
const { mainPid: pid, cid } = await topics.getTopicFields(tid, ['mainPid', 'cid']);
// Only local categories can announce

View File

@@ -323,11 +323,12 @@ topicsAPI.move = async (caller, { tid, cid }) => {
socketHelpers.sendNotificationToTopicOwner(tid, caller.uid, 'move', 'notifications:moved-your-topic');
if (utils.isNumber(cid) && parseInt(cid, 10) === -1) {
activitypub.out.remove.context(caller.uid, tid);
// tbd: activitypubApi.undo.announce?
activitypub.out.remove.context(caller.uid, tid); // 7888-style
activitypub.out.delete.note(caller.uid, topicData.mainPid); // threadiverse
// tbd: activitypubApi.undo.announce? // microblogs
} else {
activitypub.out.move.context(caller.uid, tid);
activitypub.out.announce.category(tid);
activitypub.out.announce.topic(tid);
}
}