aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/app.js2
-rw-r--r--lib/serve.js14
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/app.js b/lib/app.js
index 86dcd87..cdbc93c 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -105,7 +105,7 @@ function App(sbot, config) {
this.sbot.status && 'status',
'channels',
'tags',
- 'friends',
+ this.sbot.friends && 'friends',
'search',
'live',
'compose',
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, [