aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/app.js b/lib/app.js
index 22e1e0e..99ba776 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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) {