diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-02 14:14:23 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-02 14:14:23 -1000 |
commit | bd9fdd3d21b5bad6f5e1d11a7196b899c8bcff05 (patch) | |
tree | 2f1ef660a6516f55a791ed3acc8cfe8daa1b329e /lib/serve.js | |
parent | cd96cd050a4a7f6b65f684c05b3c56915254e069 (diff) | |
download | patchfoo-bd9fdd3d21b5bad6f5e1d11a7196b899c8bcff05.tar.gz patchfoo-bd9fdd3d21b5bad6f5e1d11a7196b899c8bcff05.zip |
Show undecryptable thread root
Diffstat (limited to 'lib/serve.js')
-rw-r--r-- | lib/serve.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js index 41ff025..4fe3cd6 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -31,6 +31,11 @@ function isMsgEncrypted(msg) { return typeof c === 'string' } +function isMsgReadable(msg) { + var c = msg && msg.value && msg.value.content + return typeof c === 'object' && c !== null +} + function ctype(name) { switch (name && /[^.\/]*$/.exec(name)[0] || 'html') { case 'html': return 'text/html' @@ -346,6 +351,7 @@ Serve.prototype.private = function (ext) { this.app.createLogStream(opts), pull.filter(isMsgEncrypted), this.app.unboxMessages(), + pull.filter(isMsgReadable), pull.take(limit), this.renderThreadPaginated(opts, null, q), this.wrapMessages(), |