From 22dbf15e5ec54154458371f0482b2315b18152aa Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 29 Oct 2024 14:51:55 -0400 Subject: [PATCH] fix: errant mention detection via actors.note - also removed duplicate parsing of post content when retrieving object via AP --- src/activitypub/mocks.js | 2 +- src/controllers/activitypub/actors.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index 5681425843..e1e2e0f581 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -349,7 +349,7 @@ Mocks.notes.public = async (post) => { } if (mentionsEnabled) { const mentions = require.main.require('nodebb-plugin-mentions'); - const matches = await mentions.getMatches(post.content); + const matches = await mentions.getMatches(content); if (matches.size) { tag = tag || []; diff --git a/src/controllers/activitypub/actors.js b/src/controllers/activitypub/actors.js index b7ecdec173..b477069927 100644 --- a/src/controllers/activitypub/actors.js +++ b/src/controllers/activitypub/actors.js @@ -69,7 +69,7 @@ Actors.note = async function (req, res) { } const post = (await posts.getPostSummaryByPids([req.params.pid], req.uid, { - stripTags: false, + parse: false, extraFields: ['edited'], })).pop(); if (!post) {