Commit 4e0dae39f1a245880675dff53fc9bfff65262448
Merge branch 'master' of github.com:ssbc/patchcore into contact_blocking
mix irving committed on 9/14/2017, 12:35:35 AMParent: 7bd9775b75c52ca02f3e47ccb20e59533accb156
Parent: 80c1f8b2d9deccfbefd2ceb690fd4255b3626c94
Files changed
about/obs.js | changed |
about/sync.js | added |
contact/async.js | changed |
invite.js | changed |
package-lock.json | changed |
package.json | changed |
about/obs.js | ||
---|---|---|
@@ -7,8 +7,9 @@ | ||
7 | 7 | |
8 | 8 | exports.needs = nest({ |
9 | 9 | 'sbot.pull.stream': 'first', |
10 | 10 | 'blob.sync.url': 'first', |
11 | + 'about.sync.shortFeedId': 'first', | |
11 | 12 | 'keys.sync.id': 'first' |
12 | 13 | }) |
13 | 14 | |
14 | 15 | exports.gives = nest({ |
@@ -34,9 +35,9 @@ | ||
34 | 35 | |
35 | 36 | return nest({ |
36 | 37 | 'about.obs': { |
37 | 38 | // quick helpers, probably should deprecate! |
38 | - name: (id) => socialValue(id, 'name', id.slice(1, 10)), | |
39 | + name: (id) => socialValue(id, 'name', api.about.sync.shortFeedId(id)), | |
39 | 40 | description: (id) => socialValue(id, 'description'), |
40 | 41 | image: (id) => socialValue(id, 'image'), |
41 | 42 | names: (id) => groupedValues(id, 'name'), |
42 | 43 | images: (id) => groupedValues(id, 'image'), |
about/sync.js | ||
---|---|---|
@@ -1,0 +1,9 @@ | ||
1 | +var nest = require('depnest') | |
2 | + | |
3 | +exports.gives = nest('about.sync.shortFeedId') | |
4 | + | |
5 | +exports.create = function (api) { | |
6 | + return nest('about.sync.shortFeedId', function (id) { | |
7 | + return id.slice(1, 10) | |
8 | + }) | |
9 | +} |
contact/async.js | ||
---|---|---|
@@ -56,7 +56,6 @@ | ||
56 | 56 | contact: id, |
57 | 57 | blocking: false |
58 | 58 | }, cb) |
59 | 59 | } |
60 | - | |
61 | 60 | } |
62 | 61 |
invite.js | ||
---|---|---|
@@ -13,9 +13,9 @@ | ||
13 | 13 | }) |
14 | 14 | |
15 | 15 | exports.gives = nest({ |
16 | 16 | 'invite.async.accept': true, |
17 | - 'invite.async.autofollow': true, | |
17 | + 'invite.async.autofollow': true | |
18 | 18 | }) |
19 | 19 | |
20 | 20 | exports.create = function (api) { |
21 | 21 | function accept (invite, cb) { |
@@ -79,15 +79,15 @@ | ||
79 | 79 | return progress |
80 | 80 | } |
81 | 81 | return nest({ |
82 | 82 | 'invite.async.accept': accept, |
83 | - //like invite, but check whether we already follow them first | |
83 | + // like invite, but check whether we already follow them first | |
84 | 84 | 'invite.async.autofollow': function (invite, cb) { |
85 | 85 | var id = api.keys.sync.id() |
86 | 86 | var data = ref.parseInvite(invite) |
87 | 87 | api.contact.async.followerOf(id, data.key, function (_, follows) { |
88 | 88 | if (follows) console.log('already following', cb()) |
89 | - else console.log('accept invite:'+invite, accept(invite, cb)) | |
89 | + else console.log('accept invite:' + invite, accept(invite, cb)) | |
90 | 90 | }) |
91 | 91 | } |
92 | 92 | }) |
93 | 93 | } |
Built with git-ssb-web