From 8cb9852058e36cddafb6eb63f621468a855c83b8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Apr 2019 18:45:07 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=97=E3=83=A9=E3=82=A4=E5=85=88?= =?UTF-8?q?=E3=82=92=E3=82=A8=E3=83=A9=E3=83=BC=E6=99=82=E3=81=AB=E7=84=A1?= =?UTF-8?q?=E8=A6=96=E3=81=99=E3=82=8B=E3=81=A8=E6=9C=AC=E6=9D=A5=E3=81=AF?= =?UTF-8?q?=E6=8A=95=E7=A5=A8=E3=81=AA=E3=81=AE=E3=81=AB=E6=8A=95=E7=A5=A8?= =?UTF-8?q?=E3=81=98=E3=82=83=E3=81=AA=E3=81=84=E3=81=A8=E6=89=B1=E3=82=8F?= =?UTF-8?q?=E3=82=8C=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8F=E3=81=AA=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/remote/activitypub/models/note.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts index 60d4cf37d..9ed2fd641 100644 --- a/src/remote/activitypub/models/note.ts +++ b/src/remote/activitypub/models/note.ts @@ -120,13 +120,15 @@ export async function createNote(value: any, resolver?: Resolver, silent = false : []; // リプライ - const reply: Note | undefined | null = note.inReplyTo - ? await resolveNote(note.inReplyTo, resolver).catch(e => { - // 4xxの場合はリプライしてないことにする - if (e.statusCode >= 400 && e.statusCode < 500) { - logger.warn(`Ignored inReplyTo ${note.inReplyTo} - ${e.statusCode} `); - return null; + const reply: Note | null = note.inReplyTo + ? await resolveNote(note.inReplyTo, resolver).then(x => { + if (x == null) { + logger.warn(`Specified inReplyTo, but nout found`); + throw 'inReplyTo not found'; + } else { + return x; } + }).catch(e => { logger.warn(`Error in inReplyTo ${note.inReplyTo} - ${e.statusCode || e}`); throw e; })