diff options
Diffstat (limited to 'lib/serve.js')
-rw-r--r-- | lib/serve.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/serve.js b/lib/serve.js index e8adf3a..326c6cd 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -344,7 +344,6 @@ Serve.prototype.public = function (ext) { sortByTimestamp: q.sort === 'claimed', lt: Number(q.lt) || Date.now(), gt: Number(q.gt) || -Infinity, - limit: Number(q.limit) || 12, filter: q.filter, } @@ -352,6 +351,7 @@ Serve.prototype.public = function (ext) { this.app.createLogStream(opts), this.renderThreadPaginated(opts, null, q), this.wrapMessages(), + pull.take(Number(q.limit) || 12), this.wrapPublic(), this.wrapPage('public'), this.respondSink(200, { @@ -417,12 +417,12 @@ Serve.prototype.private = function (ext) { reverse: !q.forwards, lt: Number(q.lt) || Date.now(), gt: Number(q.gt) || -Infinity, - limit: Number(q.limit) || 12, filter: q.filter, } pull( this.app.streamPrivate(opts), + pull.take(Number(q.limit) || 12), this.renderThreadPaginated(opts, null, q), this.wrapMessages(), this.wrapPrivate(opts), @@ -441,7 +441,6 @@ Serve.prototype.mentions = function (ext) { sortByTimestamp: q.sort === 'claimed', lt: Number(q.lt) || Date.now(), gt: Number(q.gt) || -Infinity, - limit: Number(q.limit) || 12, filter: q.filter, } @@ -450,6 +449,7 @@ Serve.prototype.mentions = function (ext) { ph('h3', 'Mentions'), pull( self.app.streamMentions(opts), + pull.take(Number(q.limit) || 12), self.app.unboxMessages(), self.renderThreadPaginated(opts, null, q), self.wrapMessages() @@ -904,13 +904,13 @@ Serve.prototype.type = function (path) { reverse: !q.forwards, lt: Number(q.lt) || Date.now(), gt: Number(q.gt) || -Infinity, - limit: Number(q.limit) || 12, type: type, filter: q.filter, } pull( this.app.sbot.messagesByType(opts), + pull.take(Number(q.limit) || 12), this.renderThreadPaginated(opts, null, q), this.wrapMessages(), this.wrapType(type), @@ -970,13 +970,13 @@ Serve.prototype.channel = function (path) { reverse: !q.forwards, lt: lt, gt: gt, - limit: Number(q.limit) || 12, channel: channel, filter: q.filter, } pull( this.app.streamChannel(opts), + pull.take(Number(q.limit) || 12), this.renderThreadPaginated(opts, null, q), this.wrapMessages(), this.wrapChannel(channel), @@ -1049,7 +1049,6 @@ Serve.prototype.userFeed = function (id, path) { reverse: !q.forwards, lt: Number(q.lt) || Date.now(), gt: Number(q.gt) || -Infinity, - limit: Number(q.limit) || 20, feed: id, filter: q.filter, } @@ -1059,6 +1058,7 @@ Serve.prototype.userFeed = function (id, path) { if (err) self.app.error(err) pull( self.app.sbot.createUserStream(opts), + pull.take(Number(q.limit) || 20), self.renderThreadPaginated(opts, id, q), self.wrapMessages(), self.wrapUserFeed(isScrolled, id), |