From cdc210f0f0f7511e3ac8d78de09cc6638dbeb234 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 79a3aadc60846b0d4a7797b741410c4ea1a79989 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; }