summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-13 18:45:07 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-13 18:45:07 +0900
commit8cb9852058e36cddafb6eb63f621468a855c83b8 (patch)
treebdeef4c772090f2173922d1b89ed527202e1cc9f /src
parentFix error (diff)
downloadsharkey-8cb9852058e36cddafb6eb63f621468a855c83b8.tar.gz
sharkey-8cb9852058e36cddafb6eb63f621468a855c83b8.tar.bz2
sharkey-8cb9852058e36cddafb6eb63f621468a855c83b8.zip
リプライ先をエラー時に無視すると本来は投票なのに投票じゃないと扱われおかしくなるのでエラーにするように
Diffstat (limited to 'src')
-rw-r--r--src/remote/activitypub/models/note.ts14
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;
})