git ssb

2+

mixmix / ticktack



Commit af8e9b0bc28f9eb27558912de8569872ffa19022

restore thing which only auto-invites for new users

mix irving committed on 5/29/2018, 2:40:27 AM
Parent: 2d9c04497ae27569166c3fce934b7c17eee3753b

Files changed

app/html/app.jschanged
app/html/app.jsView
@@ -1,6 +1,6 @@
11 const nest = require('depnest')
2-const { h, Value, onceTrue } = require('mutant')
2+const { h, Value } = require('mutant')
33
44 exports.gives = nest('app.html.app')
55
66 exports.needs = nest({
@@ -14,10 +14,9 @@
1414 'settings.sync.get': 'first',
1515 'settings.sync.set': 'first',
1616 'invite.async.autofollow': 'first',
1717 'config.sync.load': 'first',
18- 'sbot.async.friendsGet': 'first',
19- 'sbot.async.get': 'first',
18+ 'sbot.async.friendsGet': 'first'
2019 })
2120
2221 exports.create = (api) => {
2322 var view
@@ -84,17 +83,17 @@
8483 console.log('no invites')
8584 return
8685 }
8786
88- useInvites(invites)
87+ // useInvites(invites)
8988 // TODO change it so that if you already have a bunch of friends you unfollow the pubs after they follow you?
9089
91- // var myKey = api.config.sync.load().keys.id
92- // api.sbot.async.friendsGet({dest: myKey}, function (err, friends) {
93- // // if you have less than 5 followers, maybe use the autoinvite
94- // if (Object.keys(friends).length <= 5) useInvites(invites)
95- // else console.log('no autoinvite - you have friends already')
96- // })
90+ var myKey = api.config.sync.load().keys.id
91+ api.sbot.async.friendsGet({dest: myKey}, function (err, friends) {
92+ // if you have less than 5 followers, use the autoinvite
93+ if (Object.keys(friends).length <= 5) useInvites(invites)
94+ else console.log('no autoinvite - you have friends already')
95+ })
9796
9897 function useInvites (invites) {
9998 invites.forEach(invite => {
10099 console.log('using invite:', invite)

Built with git-ssb-web