From db2d73a056dc9c807827b42db337ba460dd730b2 Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 12 Jun 2017 15:35:25 -1000 Subject: Use ssb-private for private page --- lib/app.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/app.js') diff --git a/lib/app.js b/lib/app.js index 3ff8b81..eca2a9f 100644 --- a/lib/app.js +++ b/lib/app.js @@ -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) + ) +} -- cgit v1.2.3