aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-06 16:31:52 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-06 16:31:52 -0700
commit22c9b2a241735a70f76473b4bb37fe530219e31c (patch)
tree0607990d9f14258ec013b5d8388ae03eac1c98b4
parentd15de8444d2b2effe2a157b6c9c3f5818cdab78e (diff)
downloadpatchfoo-22c9b2a241735a70f76473b4bb37fe530219e31c.tar.gz
patchfoo-22c9b2a241735a70f76473b4bb37fe530219e31c.zip
Ignore duplicate mentions
-rw-r--r--lib/serve.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 7180f7a..ca6b2ae 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -971,6 +971,7 @@ Serve.prototype.composer = function (opts, cb) {
var myId = self.app.sbot.id
var content
var unknownMentions = []
+ var unknownMentionNames = {}
try {
content = JSON.parse(data.text)
} catch (err) {
@@ -991,6 +992,8 @@ Serve.prototype.composer = function (opts, cb) {
} else if (mention.link === '@') {
// bare feed name
var name = mention.name
+ if (unknownMentionNames[name]) return false
+ unknownMentionNames[name] = true
var fullName = mention.link + name
var id = formNames[name] || self.app.getReverseNameSync(fullName)
unknownMentions.push({name: name, fullName: fullName, id: id})