aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/app.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index 03760ff..052c767 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -274,10 +274,22 @@ App.prototype.pullGetMsg = function (id) {
App.prototype.createLogStream = function (opts) {
opts = opts || {}
return opts.sortByTimestamp
- ? this.sbot.createFeedStream(opts)
+ ? this.createFeedStream(opts)
: this.sbot.createLogStream(opts)
}
+App.prototype.createFeedStream = function (opts) {
+ // work around opts.gt being treated as opts.gte sometimes
+ if (opts.gt && opts.limit && !opts.reverse) return pull(
+ this.sbot.createFeedStream(u.mergeOpts(opts, {limit: opts.limit + 1})),
+ pull.filter(function (msg) {
+ return msg && msg.value.timestamp !== opts.gt
+ }),
+ opts.limit && pull.take(opts.limit)
+ )
+ return this.sbot.createFeedStream(opts)
+}
+
var stateVals = {
connected: 3,
connecting: 2,