diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-20 16:11:57 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-20 16:12:11 -1000 |
commit | 33757c47cd4bbcda6e38cbd0cc8a70c5c0b19b44 (patch) | |
tree | 7db0898532ec0ccebb96d12071209eabb7167b88 /lib | |
parent | 13a679793e88e66d13fa7d8512201c70c15154a8 (diff) | |
download | patchfoo-33757c47cd4bbcda6e38cbd0cc8a70c5c0b19b44.tar.gz patchfoo-33757c47cd4bbcda6e38cbd0cc8a70c5c0b19b44.zip |
Fix pairwise contact calculation
Diffstat (limited to 'lib')
-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) ) } |