fix: defer federation of new topics when topic is scheduled, tie activitypub api module to global enable toggle

This commit is contained in:
Julian Lam
2024-02-26 15:39:09 -05:00
parent aadac7053a
commit 5f85e70006
4 changed files with 57 additions and 17 deletions

View File

@@ -80,7 +80,10 @@ topicsAPI.create = async function (caller, data) {
socketHelpers.emitToUids('event:new_post', { posts: [result.postData] }, [caller.uid]);
socketHelpers.emitToUids('event:new_topic', result.topicData, [caller.uid]);
socketHelpers.notifyNew(caller.uid, 'newTopic', { posts: [result.postData], topic: result.topicData });
activitypubApi.create.post(caller, { pid: result.postData.pid });
if (!isScheduling) {
activitypubApi.create.post(caller, { pid: result.postData.pid });
}
return result.topicData;
};