fix hidden post behavior

This commit is contained in:
April John 2023-05-08 11:23:23 +02:00
parent 4d9b4b65d3
commit 8c6475961e
1 changed files with 4 additions and 1 deletions

View File

@ -170,6 +170,8 @@ export default async (
) => ) =>
// rome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME // rome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME
new Promise<Note>(async (res, rej) => { new Promise<Note>(async (res, rej) => {
const dontFederateInitially = data.localOnly || data.visibility === "hidden";
// If you reply outside the channel, match the scope of the target. // 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.) // TODO (I think it's a process that could be done on the client side, but it's server side for now.)
if ( if (
@ -196,6 +198,7 @@ export default async (
if (data.channel != null) data.visibility = "public"; if (data.channel != null) data.visibility = "public";
if (data.channel != null) data.visibleUsers = []; if (data.channel != null) data.visibleUsers = [];
if (data.channel != null) data.localOnly = true; if (data.channel != null) data.localOnly = true;
if (data.visibility === "hidden") data.visibility = "public";
// enforce silent clients on server // enforce silent clients on server
if ( if (
@ -546,7 +549,7 @@ export default async (
}); });
//#region AP deliver //#region AP deliver
if (Users.isLocalUser(user)) { if (Users.isLocalUser(user) && !dontFederateInitially) {
(async () => { (async () => {
const noteActivity = await renderNoteOrRenoteActivity(data, note); const noteActivity = await renderNoteOrRenoteActivity(data, note);
const dm = new DeliverManager(user, noteActivity); const dm = new DeliverManager(user, noteActivity);