diff options
Diffstat (limited to 'lib/app.js')
-rw-r--r-- | lib/app.js | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -201,6 +201,21 @@ App.prototype.streamPeers = function (opts) { }) } +App.prototype.getFollow = function (source, dest, cb) { + var self = this + pull( + self.sbot.links({source: source, dest: dest, rel: 'contact', values: true}), + pull.filter(function (msg) { + var c = msg && msg.value && msg.value.content + return c && c.type === 'contact' + }), + pull.reduce(function (doesFollow, msg) { + var c = msg.value.content + return !!c.following + }, false, cb) + ) +} + App.prototype.getFollows = function (id, cb) { var self = this pull( |