From 4a1dbfad297079dc94ea94b20d3117eeaafd6480 Mon Sep 17 00:00:00 2001 From: Kio-td Date: Fri, 10 Feb 2023 00:19:47 -0500 Subject: [PATCH 1/2] Close #9473 --- packages/backend/src/remote/activitypub/models/note.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/models/note.ts b/packages/backend/src/remote/activitypub/models/note.ts index 72953c5bf..0b6dd3eed 100644 --- a/packages/backend/src/remote/activitypub/models/note.ts +++ b/packages/backend/src/remote/activitypub/models/note.ts @@ -123,7 +123,8 @@ export async function createNote( // Skip if author is suspended. if (actor.isSuspended) { - throw new Error("actor has been suspended"); + logger.debug(`User ${`${actor.usernameLower}@${actor.host}`} suspended; discarding.`) + return null; } const noteAudience = await parseAudience(actor, note.to, note.cc); From f08e5cd250bf8c932fd713777dd0338ad9829952 Mon Sep 17 00:00:00 2001 From: Kio-td Date: Fri, 10 Feb 2023 00:38:23 -0500 Subject: [PATCH 2/2] Clean up bad coding practices --- packages/backend/src/remote/activitypub/models/note.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/models/note.ts b/packages/backend/src/remote/activitypub/models/note.ts index 0b6dd3eed..afb3af6cb 100644 --- a/packages/backend/src/remote/activitypub/models/note.ts +++ b/packages/backend/src/remote/activitypub/models/note.ts @@ -123,7 +123,7 @@ export async function createNote( // Skip if author is suspended. if (actor.isSuspended) { - logger.debug(`User ${`${actor.usernameLower}@${actor.host}`} suspended; discarding.`) + logger.debug(`User ${actor.usernameLower}@${actor.host} suspended; discarding.`) return null; }