git ssb

2+

mixmix / ticktack



Commit 5f59445f9e468790a0106acff65bdd3ce873c37a

Merge branch 'master' of github.com:ticktackim/ticktack-wp1 into blob-blog

mix irving committed on 12/8/2017, 1:50:28 AM
Parent: 35ee32eefff5c36f236876e4918c46cbeb22ef6d
Parent: 4f3123cd652a5603873f1d2e87d6016552e7b4c8

Files changed

config.jschanged
default-config.jsonchanged
main.jschanged
ssb-config.jsonadded
config.jsView
@@ -3,12 +3,10 @@
33 const ssbKeys = require('ssb-keys')
44 const Path = require('path')
55
66 // const appName = process.env.ssb_appname || 'ticktack' //'ticktack' TEMP: this is for the windowsSSB installer only
7-const appName = 'ssb'
8-const opts = appName == 'ssb'
9- ? null
10- : require('./default-config.json')
7+const appName = process.env.ssb_appname || 'ssb'
8+var opts = appName === 'ssb' ? require('./ssb-config.json') : require('./default-config')
119
1210 exports.gives = nest('config.sync.load')
1311 exports.create = (api) => {
1412 var config
@@ -22,4 +20,5 @@
2220 }
2321 return config
2422 })
2523 }
24+
default-config.jsonView
@@ -1,9 +1,9 @@
11 {
2- "port": 43750,
3- "blobsPort": 43751,
4- "ws": { "port": 43751 },
5- "caps": {"shs": "ErgQF85hFQpUXp69IXtLW+nXDgFIOKKDOWFX/st2aWk="},
2+ "_port": 43750,
3+ "_blobsPort": 43751,
4+ "_ws": { "port": 43751 },
5+ "_caps": {"shs": "ErgQF85hFQpUXp69IXtLW+nXDgFIOKKDOWFX/st2aWk="},
66 "autoinvite": "128.199.132.182:43750:@7xMrWP8708+LDvaJrRMRQJEixWYp4Oipa9ohqY7+NyQ=.ed25519~YC4ZnjHH8qzsyHe2sihW8WDlhxSUH33IthOi4EsldwQ="
77 }
88
99
main.jsView
@@ -45,19 +45,29 @@
4545
4646 const api = entry(sockets, nest({
4747 'app.html.app': 'first',
4848 'invite.async.autofollow': 'first',
49- 'config.sync.load': 'first'
49+ 'config.sync.load': 'first',
50+ 'sbot.async.friendsGet': 'first',
51+ 'sbot.async.get': 'first'
5052 }))
5153
5254 document.body.appendChild(api.app.html.app())
55+// console.log(api.config.sync.load())
5356
5457 var invite = api.config.sync.load().autoinvite
55-if(invite)
56- api.invite.async.autofollow(
57- invite,
58- function (err, follows) {
59- console.log('autofollowed', err, follows);
58+var self_id = api.config.sync.load().keys.id
59+if(invite) {
60+ api.sbot.async.friendsGet({dest: self_id}, function (err, friends) {
61+ //if you have less than 5 followers, maybe use the autoinvite
62+ if(Object.keys(friends).length <= 5)
63+ api.invite.async.autofollow(
64+ invite,
65+ function (err, follows) { console.log('autofollowed', err, follows) }
66+ )
67+ else
68+ console.log('no autoinvite - you have friends already')
6069 })
70+}
6171 else
6272 console.log('no invite')
6373
ssb-config.jsonView
@@ -1,0 +1,3 @@
1+{
2+ "autoinvite": "128.199.132.182:43750:@7xMrWP8708+LDvaJrRMRQJEixWYp4Oipa9ohqY7+NyQ=.ed25519~YC4ZnjHH8qzsyHe2sihW8WDlhxSUH33IthOi4EsldwQ"
3+}

Built with git-ssb-web