diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-10-13 13:54:34 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-10-13 13:54:34 -1000 |
commit | 42934b9b8952245a7d37b17ca0bb119e82ebd96c (patch) | |
tree | 294837485b9018642d1f709ca6dd00178297a2fc /lib/app.js | |
parent | 4cdef510b17e915fb1c743293f81458e3b0bf8d9 (diff) | |
download | patchfoo-42934b9b8952245a7d37b17ca0bb119e82ebd96c.tar.gz patchfoo-42934b9b8952245a7d37b17ca0bb119e82ebd96c.zip |
Allow specifying default filter setting
Diffstat (limited to 'lib/app.js')
-rw-r--r-- | lib/app.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |