aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/app.js b/lib/app.js
index fc395a2..22e1e0e 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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)
)
}