Autoreconnect
This commit is contained in:
parent
5d408edb31
commit
a51210b9cc
3
bot.go
3
bot.go
|
@ -2,6 +2,7 @@ package bot
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"cwtch.im/cwtch/app"
|
"cwtch.im/cwtch/app"
|
||||||
|
"cwtch.im/cwtch/app/plugins"
|
||||||
"cwtch.im/cwtch/event"
|
"cwtch.im/cwtch/event"
|
||||||
"cwtch.im/cwtch/peer"
|
"cwtch.im/cwtch/peer"
|
||||||
"git.openprivacy.ca/openprivacy/libricochet-go/connectivity"
|
"git.openprivacy.ca/openprivacy/libricochet-go/connectivity"
|
||||||
|
@ -34,6 +35,7 @@ func (cb *CwtchBot) Launch() {
|
||||||
cb.acn.WaitTillBootstrapped()
|
cb.acn.WaitTillBootstrapped()
|
||||||
app := app.NewApp(mn, cb.dir)
|
app := app.NewApp(mn, cb.dir)
|
||||||
|
|
||||||
|
|
||||||
app.LoadProfiles("")
|
app.LoadProfiles("")
|
||||||
if len(app.ListPeers()) == 0 {
|
if len(app.ListPeers()) == 0 {
|
||||||
app.CreatePeer(cb.peername, "")
|
app.CreatePeer(cb.peername, "")
|
||||||
|
@ -41,6 +43,7 @@ func (cb *CwtchBot) Launch() {
|
||||||
|
|
||||||
peers := app.ListPeers()
|
peers := app.ListPeers()
|
||||||
for onion, _ := range peers {
|
for onion, _ := range peers {
|
||||||
|
app.AddPeerPlugin(onion, plugins.CONNECTIONRETRY)
|
||||||
cb.Peer = app.GetPeer(onion)
|
cb.Peer = app.GetPeer(onion)
|
||||||
log.Infof("Running %v", onion)
|
log.Infof("Running %v", onion)
|
||||||
cb.Queue = event.NewQueue()
|
cb.Queue = event.NewQueue()
|
||||||
|
|
Loading…
Reference in New Issue