From e99d2b632315bdc00fc1725a265f3aec29ea5577 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 22 Feb 2024 00:26:46 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A6=81=E6=AD=A2=E3=82=AD=E3=83=BC?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E3=82=92=E5=90=AB=E3=82=80=E3=83=8E?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=82=84=E3=83=AA=E3=83=A2=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=AE=E9=80=9A=E7=9F=A5=E3=82=92=E5=BC=95=E3=81=8D=E8=B5=B7?= =?UTF-8?q?=E3=81=93=E3=81=99=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E6=8A=95=E7=A8=BF=E3=81=AE=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=8CDelayed=20Queue=E3=81=AB=E8=BF=BD=E5=8A=A0=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E5=86=8D=E5=87=A6=E7=90=86=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E5=95=8F=E9=A1=8C=20(#468)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/queue/processors/InboxProcessorService.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/queue/processors/InboxProcessorService.ts b/packages/backend/src/queue/processors/InboxProcessorService.ts index 04a359b5a5..0478de88e2 100644 --- a/packages/backend/src/queue/processors/InboxProcessorService.ts +++ b/packages/backend/src/queue/processors/InboxProcessorService.ts @@ -24,6 +24,7 @@ import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js'; import { LdSignatureService } from '@/core/activitypub/LdSignatureService.js'; import { ApInboxService } from '@/core/activitypub/ApInboxService.js'; import { bindThis } from '@/decorators.js'; +import { IdentifiableError } from '@/misc/identifiable-error.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type { InboxJobData } from '../types.js'; @@ -180,7 +181,15 @@ export class InboxProcessorService { }); // アクティビティを処理 - await this.apInboxService.performActivity(authUser.user, activity, job.data.user?.id); + try { + await this.apInboxService.performActivity(authUser.user, activity, job.data.user?.id); + } catch (e) { + if (e instanceof IdentifiableError) { + if (e.id === 'e11b3a16-f543-4885-8eb1-66cad131dbfd') return 'blocked mentions from unfamiliar user'; + if (e.id === '057d8d3e-b7ca-4f8b-b38c-dcdcbf34dc30') return 'blocked notes with prohibited words'; + } + throw e; + } return 'ok'; } }