aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js10
-rw-r--r--lib/serve.js6
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/app.js b/lib/app.js
index 6653c1d..d20b2b5 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -15,11 +15,6 @@ var Render = require('./render')
module.exports = App
-function isMsgReadable(msg) {
- var c = msg && msg.value && msg.value.content
- return typeof c === 'object' && c !== null
-}
-
function App(sbot, config) {
this.sbot = sbot
this.config = config
@@ -268,10 +263,7 @@ App.prototype.getFollow = function (source, dest, cb) {
}
App.prototype.unboxMessages = function () {
- return pull(
- paramap(this.unboxMsg, 16),
- pull.filter(isMsgReadable)
- )
+ return paramap(this.unboxMsg, 16)
}
App.prototype.streamChannels = function (opts) {
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(),