Skip to content

Node.js based forum software built for the modern web

fix: wrong id parsed in announce

Julian Lam068c4fa90ea3
diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js
index cb5fa19a35..ea4e501242 100644
--- a/src/activitypub/inbox.js
+++ b/src/activitypub/inbox.js
@@ -93,7 +93,10 @@ inbox.announce = async (req) => {
tid = await posts.getPostField(id, 'tid');
} else {
pid = object;
- tid = await activitypub.notes.assertTopic(0, object);
+ ([pid, tid] = await Promise.all([
+ activitypub.notes.resolveId(0, pid),
+ activitypub.notes.assertTopic(0, pid),
+ ]));
if (!tid) {
return;
}