aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js
index a3082c6..9ef292a 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -1788,8 +1788,20 @@ Serve.prototype.phIdAvatar = function (id) {
Serve.prototype.friends = function (path) {
var self = this
+ var friends = self.app.sbot.friends
+ if (!friends) return pull(
+ pull.once('missing ssb-friends plugin'),
+ this.wrapPage('friends'),
+ self.respondSink(400)
+ )
+ if (!friends.createFriendStream) return pull(
+ pull.once('missing friends.createFriendStream method'),
+ this.wrapPage('friends'),
+ self.respondSink(400)
+ )
+
pull(
- self.app.sbot.friends.createFriendStream({hops: 1}),
+ friends.createFriendStream({hops: 1}),
self.renderIdsList(),
u.hyperwrap(function (items, cb) {
cb(null, [