diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-13 18:45:07 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-13 18:45:07 +0900 |
| commit | 8cb9852058e36cddafb6eb63f621468a855c83b8 (patch) | |
| tree | bdeef4c772090f2173922d1b89ed527202e1cc9f /src | |
| parent | Fix error (diff) | |
| download | sharkey-8cb9852058e36cddafb6eb63f621468a855c83b8.tar.gz sharkey-8cb9852058e36cddafb6eb63f621468a855c83b8.tar.bz2 sharkey-8cb9852058e36cddafb6eb63f621468a855c83b8.zip | |
リプライ先をエラー時に無視すると本来は投票なのに投票じゃないと扱われおかしくなるのでエラーにするように
Diffstat (limited to 'src')
| -rw-r--r-- | src/remote/activitypub/models/note.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts index 60d4cf37d7..9ed2fd641c 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; }) |