diff options
-rw-r--r-- | lib/app.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -399,17 +399,18 @@ App.prototype.streamPeers = function (opts) { App.prototype.getContact = function (source, dest, cb) { var self = this pull( - self.sbot.links({source: source, dest: dest, rel: 'contact', + self.sbot.links({source: source, dest: dest, rel: 'contact', reverse: true, values: true, meta: false, keys: false}), pull.filter(function (value) { var c = value && value.content return c && c.type === 'contact' }), + pull.take(1), pull.reduce(function (acc, value) { // trinary logic from ssb-friends return value.content.following ? true : value.content.flagged || value.content.blocking ? false - : acc + : null }, null, cb) ) } |