aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/serve.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js
index d9df589..f037783 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -116,6 +116,9 @@ Serve.prototype.go = function () {
}
}
+ this.replyMentionFeeds = conf.replyMentionFeeds == null ? true :
+ Boolean(conf.replyMentionFeeds)
+
if (this.req.method === 'POST' || this.req.method === 'PUT') {
if (/^multipart\/form-data/.test(this.req.headers['content-type'])) {
var data = {}
@@ -3893,6 +3896,18 @@ Serve.prototype.composer = function (opts, cb) {
}
]
}
+
+ if (self.replyMentionFeeds && links && content.branch) {
+ var reply = {}
+ var ids = {}
+ u.toArray(content.branch).forEach(function (branch) {
+ ids[branch] = true
+ })
+ links.forEach(function (link) {
+ if (ids[link.key]) reply[link.key] = link.value.author
+ })
+ if (Object.keys(reply).length > 0) content.reply = reply
+ }
if (data.content_warning) content.contentWarning = String(data.content_warning)
if (channel) content.channel = data.channel