mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: move Announce(Delete) out of topics.move and into topics API method
This commit is contained in:
@@ -320,7 +320,16 @@ topicsAPI.move = async (caller, { tid, cid }) => {
|
||||
socketHelpers.emitToUids('event:topic_moved', topicData, notifyUids);
|
||||
if (!topicData.deleted) {
|
||||
socketHelpers.sendNotificationToTopicOwner(tid, caller.uid, 'move', 'notifications:moved-your-topic');
|
||||
activitypubApi.announce.note(caller, { tid });
|
||||
|
||||
// AP: Announce(Delete(Object))
|
||||
if (cid === -1) {
|
||||
await activitypubApi.announce.delete({ uid: caller.uid }, { tid });
|
||||
// tbd: activitypubApi.undo.announce?
|
||||
} else {
|
||||
// tbd: some kind of plain object announce by the category...
|
||||
activitypubApi.announce.note(caller, { tid }); // user announce, remove when discrete announces are a thing
|
||||
// tbd: api.activitypub.announce.move
|
||||
}
|
||||
}
|
||||
|
||||
await events.log({
|
||||
|
||||
@@ -7,7 +7,6 @@ const topics = require('.');
|
||||
const categories = require('../categories');
|
||||
const user = require('../user');
|
||||
const plugins = require('../plugins');
|
||||
const api = require('../api');
|
||||
const privileges = require('../privileges');
|
||||
const utils = require('../utils');
|
||||
|
||||
@@ -278,13 +277,6 @@ module.exports = function (Topics) {
|
||||
const oldCid = topicData.cid;
|
||||
await categories.moveRecentReplies(tid, oldCid, cid);
|
||||
|
||||
// AP: Announce(Delete(Object))
|
||||
if (cid === -1) {
|
||||
await api.activitypub.announce.delete({ uid: data.uid }, { tid });
|
||||
} else {
|
||||
// tbd: api.activitypub.announce.move
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
Topics.setTopicFields(tid, {
|
||||
cid: cid,
|
||||
|
||||
Reference in New Issue
Block a user