From 7fa737e8b88f22d61ac7d8be7359d79782b79a9c Mon Sep 17 00:00:00 2001 From: cg sama Date: Fri, 10 Nov 2023 15:32:23 +0000 Subject: [PATCH] fix import notes federated initially Co-authored-by: CGsama --- packages/backend/src/services/note/create.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 1a80ff280..014f9ecfa 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -175,7 +175,7 @@ export default async ( ) => // rome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME new Promise(async (res, rej) => { - const dontFederateInitially = data.visibility === "hidden"; + const dontFederateInitially = data.visibility?.startsWith("hidden") === true; // 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.) @@ -209,7 +209,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.startsWith("hidden")) + if (data.visibility.startsWith("hidden") && data.visibility !== "hidden") data.visibility = data.visibility.slice(6); // enforce silent clients on server