aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-12-10 10:45:59 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-12-10 10:45:59 -1000
commita28f9dbb28295200e56066ac3ae75bc97b74669b (patch)
treebc981f3f7e8c0d60a1559782b0f35aba6b1d9a98 /lib/serve.js
parentdee0312beda7583df48e969e27efc4e1865edc71 (diff)
downloadpatchfoo-a28f9dbb28295200e56066ac3ae75bc97b74669b.tar.gz
patchfoo-a28f9dbb28295200e56066ac3ae75bc97b74669b.zip
Handle missing rpc methods
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/serve.js b/lib/serve.js
index fc8aa7b..f975f4b 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -1109,7 +1109,7 @@ Serve.prototype.type = function (path) {
}
pull(
- this.app.sbot.messagesByType(opts),
+ this.app.sbotMessagesByType(opts),
this.renderThreadPaginated(opts, null, q),
this.wrapMessages(),
this.wrapType(type),
@@ -1204,7 +1204,7 @@ Serve.prototype.streamThreadWithComposer = function (opts) {
self.getMsgDecryptedMaybeOoo(id, function (err, rootMsg) {
if (err && err.name === 'NotFoundError') err = null, rootMsg = {
key: id, value: {content: false}}
- if (err) return cb(new Error(err.stack))
+ if (err) return cb(new Error(err.stack || err))
if (!rootMsg) {
console.log('id', id, 'opts', opts)
}
@@ -1224,7 +1224,7 @@ Serve.prototype.streamThreadWithComposer = function (opts) {
self.app.unboxMessages(),
pull.through(function (msg) {
var c = msg && msg.value.content
- if (!channel && c.channel) channel = c.channel
+ if (!channel && c && c.channel) channel = c.channel
}),
pull.collect(function (err, links) {
if (err) return gotLinks(err)
@@ -1290,11 +1290,11 @@ Serve.prototype.userFeed = function (id, path) {
self.app.getAbout(id, function (err, about) {
if (err) self.app.error(err)
pull(
- self.app.sbot.createUserStream(opts),
+ self.app.sbotCreateUserStream(opts),
self.renderThreadPaginated(opts, id, q),
self.wrapMessages(),
self.wrapUserFeed(isScrolled, id),
- self.wrapPage(about.name || id),
+ self.wrapPage(about && about.name || id),
self.respondSink(200)
)
})