From 94607565ec744efb11bdb97a69a6089a4f241985 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 31 Mar 2020 20:44:23 -0400 Subject: gathering: fix previous mention filtering --- lib/serve.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/serve.js b/lib/serve.js index b80bd71..37d93eb 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -1447,6 +1447,7 @@ Serve.prototype.editGathering = function (url) { var attendeeMentions = mentionAttendees ? attendeeIds.filter(function (id) { return id !== selfId }) : [] + var previousMentions = u.toLinkArray(about.mentions).map(u.linkDest) var additionalMentions = data.mentions ? u.extractRefs(data.mentions).filter(uniques()) : [] var mentions = attendeeMentions.concat(additionalMentions) @@ -1469,7 +1470,8 @@ Serve.prototype.editGathering = function (url) { var textMentions = ssbMentions(description, {bareFeedNames: false, emoji: false}) // don't mention ids already mentioned in the thread textMentions.forEach(function (link) { - if (mentions.indexOf(link.link) === -1) { + if (mentions.indexOf(link.link) === -1 + && previousMentions.indexOf(link.link) === -1) { mentions.push(reduceLink(link)) } }) -- cgit v1.2.3