diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-21 22:01:16 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-24 12:08:34 -1000 |
commit | e3e377748bf340d5a39d201b17fe4cdbab8733c0 (patch) | |
tree | efc16672a4e52647ebbe9bdd213d445fe2f69879 /lib | |
parent | 64edc970f54ece5068510bf2cb998308296e97ef (diff) | |
download | patchfoo-e3e377748bf340d5a39d201b17fe4cdbab8733c0.tar.gz patchfoo-e3e377748bf340d5a39d201b17fe4cdbab8733c0.zip |
Allow hiding private messages
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.js | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -30,6 +30,7 @@ function App(sbot, config) { this.port = conf.port || 8027 this.host = conf.host || 'localhost' this.msgFilter = conf.filter + this.showPrivates = conf.showPrivates == null ? true : conf.showPrivates var base = conf.base || '/' this.opts = { @@ -687,9 +688,11 @@ App.prototype.filterMsg = function (msg, opts, cb) { var myId = self.sbot.id var author = msg.value && msg.value.author var filter = opts.filter || self.msgFilter + if (filter === 'all') return cb(null, true) var show = (filter !== 'invert') - if (filter === 'all' - || author === myId + var isPrivate = msg.value && typeof msg.value.content === 'string' + if (isPrivate && !self.showPrivates) return cb(null, !show) + if (author === myId || author === opts.feed || msg.key === opts.msgId) return cb(null, show) self.follows.getFollows(myId, function (err, follows) { |