aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/serve.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js
index f7e8330..7237a88 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -517,6 +517,7 @@ Serve.prototype.path = function (url) {
switch (m[1]) {
case '/new': return this.new(m[2])
case '/public': return this.public(m[2])
+ case '/logbook': return this.logbook(m[2])
case '/threads': return this.threads(m[2])
case '/private': return this.private(m[2])
case '/mentions': return this.mentions(m[2])
@@ -575,6 +576,32 @@ Serve.prototype.home = function () {
)
}
+Serve.prototype.logbook = function (ext) {
+ var q = this.query
+ var opts = {
+ reverse: !q.forwards,
+ //sortByTimestamp: q.sort === 'claimed',
+ sortByTimestamp: q.sort || 'claimed',
+ lt: Number(q.lt) || Date.now(),
+ gt: Number(q.gt) || -Infinity,
+ filter: q.filter,
+ }
+
+ pull(
+ this.app.createLogStream(opts),
+ pull.filter(msg => {
+ return !msg.value.content.vote
+ }),
+ this.renderThreadPaginated(opts, null, q),
+ this.wrapMessages(),
+ this.wrapPublic(),
+ this.wrapPage('public'),
+ this.respondSink(200, {
+ 'Content-Type': ctype(ext)
+ })
+ )
+}
+
Serve.prototype.public = function (ext) {
var q = this.query
var opts = {