From 4a53238c5a95193f26012e464e07094c32cbda99 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 3 Mar 2020 14:57:20 -0500 Subject: Add "single" mode --- lib/serve.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/serve.js b/lib/serve.js index 5b49983..39c1138 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -1442,11 +1442,24 @@ Serve.prototype.streamThreadWithComposer = function (opts) { } } +Serve.prototype.streamMsg = function (id) { + var self = this + return pull( + self.app.pullGetMsg(id), + self.renderThread({ + msgId: id + }), + self.wrapMessages() + ) +} + Serve.prototype.id = function (id, path) { var self = this if (self.query.raw != null) return self.rawId(id) pull( - self.streamThreadWithComposer({root: id}), + self.query.single != null + ? self.streamMsg(id) + : self.streamThreadWithComposer({root: id}), self.wrapPage(id), self.respondSink(200) ) -- cgit v1.2.3