update cwtch; lcg half of moving acnStatus handler to cwtch
This commit is contained in:
parent
ece1df0ce9
commit
20065b238d
4
go.mod
4
go.mod
|
@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/cwtch-autobindings
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cwtch.im/cwtch v0.20.3
|
cwtch.im/cwtch v0.20.4
|
||||||
git.openprivacy.ca/cwtch.im/server v1.4.5
|
git.openprivacy.ca/cwtch.im/server v1.4.5
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.8.7
|
git.openprivacy.ca/openprivacy/connectivity v1.8.7
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.3
|
git.openprivacy.ca/openprivacy/log v1.0.3
|
||||||
|
@ -24,4 +24,4 @@ require (
|
||||||
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect
|
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect
|
||||||
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect
|
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect
|
||||||
golang.org/x/tools v0.1.12 // indirect
|
golang.org/x/tools v0.1.12 // indirect
|
||||||
)
|
)
|
2
go.sum
2
go.sum
|
@ -1,6 +1,8 @@
|
||||||
cwtch.im/cwtch v0.18.0/go.mod h1:StheazFFY7PKqBbEyDVLhzWW6WOat41zV0ckC240c5Y=
|
cwtch.im/cwtch v0.18.0/go.mod h1:StheazFFY7PKqBbEyDVLhzWW6WOat41zV0ckC240c5Y=
|
||||||
cwtch.im/cwtch v0.20.3 h1:CaMh7y8ddxWAlpxMUxRniU6SKXwZQKMqLrWKpP8heVc=
|
cwtch.im/cwtch v0.20.3 h1:CaMh7y8ddxWAlpxMUxRniU6SKXwZQKMqLrWKpP8heVc=
|
||||||
cwtch.im/cwtch v0.20.3/go.mod h1:h8S7EgEM+8pE1k+XLB5jAFdIPlOzwoXEY0GH5mQye5A=
|
cwtch.im/cwtch v0.20.3/go.mod h1:h8S7EgEM+8pE1k+XLB5jAFdIPlOzwoXEY0GH5mQye5A=
|
||||||
|
cwtch.im/cwtch v0.20.4 h1:kWPWX1zti+9LSnWP/ptRMGkB6byPek2vdp+8u+xq31k=
|
||||||
|
cwtch.im/cwtch v0.20.4/go.mod h1:h8S7EgEM+8pE1k+XLB5jAFdIPlOzwoXEY0GH5mQye5A=
|
||||||
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
||||||
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
|
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
|
||||||
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
||||||
|
|
|
@ -103,30 +103,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if newAcnStatus == 100 {
|
|
||||||
if acnStatus != 100 {
|
|
||||||
for _, onion := range eh.app.ListProfiles() {
|
|
||||||
profile := eh.app.GetPeer(onion)
|
|
||||||
if profile != nil {
|
|
||||||
autostart, exists := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerAutostart)
|
|
||||||
if !exists || autostart == "true" {
|
|
||||||
eh.app.ActivatePeerEngine(onion)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//eh.api.LaunchServers()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if acnStatus == 100 {
|
|
||||||
// just fell offline
|
|
||||||
for _, onion := range eh.app.ListProfiles() {
|
|
||||||
eh.app.DeactivatePeerEngine(onion)
|
|
||||||
}
|
|
||||||
//eh.api.StopServers()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
acnStatus = newAcnStatus
|
acnStatus = newAcnStatus
|
||||||
|
|
||||||
for _, module := range eh.modules {
|
for _, module := range eh.modules {
|
||||||
module.OnACNStatusEvent(eh.app, e)
|
module.OnACNStatusEvent(eh.app, e)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue