From 8c6475961ec01e1d02aa1ad440d116cc5535bf3a Mon Sep 17 00:00:00 2001 From: April John Date: Mon, 8 May 2023 11:23:23 +0200 Subject: [PATCH] fix hidden post behavior --- packages/backend/src/services/note/create.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index f2ccdca226..5259a57c0e 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -170,6 +170,8 @@ export default async ( ) => // rome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME new Promise(async (res, rej) => { + const dontFederateInitially = data.localOnly || data.visibility === "hidden"; + // If you reply outside the channel, match the scope of the target. // TODO (I think it's a process that could be done on the client side, but it's server side for now.) if ( @@ -196,6 +198,7 @@ export default async ( if (data.channel != null) data.visibility = "public"; if (data.channel != null) data.visibleUsers = []; if (data.channel != null) data.localOnly = true; + if (data.visibility === "hidden") data.visibility = "public"; // enforce silent clients on server if ( @@ -546,7 +549,7 @@ export default async ( }); //#region AP deliver - if (Users.isLocalUser(user)) { + if (Users.isLocalUser(user) && !dontFederateInitially) { (async () => { const noteActivity = await renderNoteOrRenoteActivity(data, note); const dm = new DeliverManager(user, noteActivity);