aboutsummaryrefslogtreecommitdiff
path: root/lib/app.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-10-13 13:54:34 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-10-13 13:54:34 -1000
commit42934b9b8952245a7d37b17ca0bb119e82ebd96c (patch)
tree294837485b9018642d1f709ca6dd00178297a2fc /lib/app.js
parent4cdef510b17e915fb1c743293f81458e3b0bf8d9 (diff)
downloadpatchfoo-42934b9b8952245a7d37b17ca0bb119e82ebd96c.tar.gz
patchfoo-42934b9b8952245a7d37b17ca0bb119e82ebd96c.zip
Allow specifying default filter setting
Diffstat (limited to 'lib/app.js')
-rw-r--r--lib/app.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/app.js b/lib/app.js
index 3db24b8..71fd3f0 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -28,6 +28,7 @@ function App(sbot, config) {
var conf = config.patchfoo || {}
this.port = conf.port || 8027
this.host = conf.host || 'localhost'
+ this.filter = conf.filter
var base = conf.base || '/'
this.opts = {
@@ -678,8 +679,9 @@ App.prototype.filterMsg = function (msg, opts, cb) {
var self = this
var myId = self.sbot.id
var author = msg.value && msg.value.author
- var show = (opts.filter !== 'invert')
- if (opts.filter === 'all'
+ var filter = opts.filter || self.filter
+ var show = (filter !== 'invert')
+ if (filter === 'all'
|| author === myId
|| author === opts.feed
|| msg.key === opts.msgId) return cb(null, show)