From 291af926a64e761ad98aac17a9e11b2db65fe754 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 11 Mar 2025 15:17:10 -0400 Subject: [PATCH] fix: bug where remote post was attempted to be announced on post move --- src/api/posts.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/posts.js b/src/api/posts.js index dbdec5817d..a7111e0c22 100644 --- a/src/api/posts.js +++ b/src/api/posts.js @@ -322,9 +322,11 @@ postsAPI.move = async function (caller, data) { if (!postDeleted && !topicDeleted) { socketHelpers.sendNotificationToPostOwner(data.pid, caller.uid, 'move', 'notifications:moved-your-post'); - // ideally we should federate a "move" activity instead. tbd - const { activity } = await activitypub.mocks.activities.create(data.pid, caller.uid); - await activitypub.feps.announce(data.pid, activity); + // ideally we should federate a "move" activity instead, then can capture remote posts too. tbd + if (utils.isNumber(data.pid)) { + const { activity } = await activitypub.mocks.activities.create(data.pid, caller.uid); + await activitypub.feps.announce(data.pid, activity); + } } };