aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-03-31 20:44:23 -0400
committercel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-04-01 21:23:54 -0400
commit94607565ec744efb11bdb97a69a6089a4f241985 (patch)
treee0cc9c520eb9de3738ce762b508bf20b7dae4dd0 /lib
parentc7f66679227bac85868e13b38defa836e96b725f (diff)
downloadpatchfoo-94607565ec744efb11bdb97a69a6089a4f241985.tar.gz
patchfoo-94607565ec744efb11bdb97a69a6089a4f241985.zip
gathering: fix previous mention filtering
Diffstat (limited to 'lib')
-rw-r--r--lib/serve.js4
1 files changed, 3 insertions, 1 deletions
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))
}
})