fix: bug where remote post was attempted to be announced on post move

This commit is contained in:
Julian Lam
2025-03-11 15:17:10 -04:00
parent 254f0738bb
commit 291af926a6

View File

@@ -322,9 +322,11 @@ postsAPI.move = async function (caller, data) {
if (!postDeleted && !topicDeleted) { if (!postDeleted && !topicDeleted) {
socketHelpers.sendNotificationToPostOwner(data.pid, caller.uid, 'move', 'notifications:moved-your-post'); socketHelpers.sendNotificationToPostOwner(data.pid, caller.uid, 'move', 'notifications:moved-your-post');
// ideally we should federate a "move" activity instead. tbd // ideally we should federate a "move" activity instead, then can capture remote posts too. tbd
const { activity } = await activitypub.mocks.activities.create(data.pid, caller.uid); if (utils.isNumber(data.pid)) {
await activitypub.feps.announce(data.pid, activity); const { activity } = await activitypub.mocks.activities.create(data.pid, caller.uid);
await activitypub.feps.announce(data.pid, activity);
}
} }
}; };