From 81b81e540af421dbc7b2feb529b2a79050de2d64 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 7 Mar 2024 15:11:43 -0500 Subject: [PATCH] fix: tags received via AP should only be of type Hashtag (as mentions are also in tag prop --- src/activitypub/notes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index 55bb4e906a..e39e64171a 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -259,7 +259,9 @@ Notes.assertTopic = async (uid, id) => { let tags; if (!hasTid) { - tags = (mainPost._activitypub.tag || []).map(o => o.name.slice(1)); + tags = (mainPost._activitypub.tag || []) + .filter(o => o.type === 'Hashtag') + .map(o => o.name.slice(1)); tags = await topics.filterTags(tags, cid); await topics.create({