From 42934b9b8952245a7d37b17ca0bb119e82ebd96c Mon Sep 17 00:00:00 2001 From: cel Date: Fri, 13 Oct 2017 13:54:34 -1000 Subject: Allow specifying default filter setting --- lib/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3