diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-06-12 15:35:25 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-06-12 15:35:25 -1000 |
commit | db2d73a056dc9c807827b42db337ba460dd730b2 (patch) | |
tree | f03e2347ef61075596d98aa3b1a46fc487629efd /lib/app.js | |
parent | 631791d5345cbc1c29fc844d5785139dff746958 (diff) | |
download | patchfoo-db2d73a056dc9c807827b42db337ba460dd730b2.tar.gz patchfoo-db2d73a056dc9c807827b42db337ba460dd730b2.zip |
Use ssb-private for private page
Diffstat (limited to 'lib/app.js')
-rw-r--r-- | lib/app.js | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -521,3 +521,23 @@ App.prototype.streamMentions = function (opts) { }}] })) } + +App.prototype.streamPrivate = function (opts) { + if (this.sbot.private.read) return this.sbot.private.read(u.mergeOpts(opts, { + query: [{$filter: { + timestamp: { + $gt: opts.gt, + $lt: opts.lt, + } + }}] + })) + + + return pull + this.createLogStream(u.mergeOpts(opts, {limit: null}), + pull.filter(u.isMsgEncrypted), + this.unboxMessages(), + pull.filter(u.isMsgReadable), + pull.take(opts.limit) + ) +} |