fix logic error on loading peer
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
4c48fd603d
commit
4903e9376b
4
go.mod
4
go.mod
|
@ -3,10 +3,10 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go
|
||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cwtch.im/cwtch v0.14.4
|
cwtch.im/cwtch v0.14.5
|
||||||
git.openprivacy.ca/cwtch.im/server v1.4.1
|
git.openprivacy.ca/cwtch.im/server v1.4.1
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.5.0
|
git.openprivacy.ca/openprivacy/connectivity v1.5.0
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.3
|
git.openprivacy.ca/openprivacy/log v1.0.3
|
||||||
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
|
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
|
||||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect
|
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect
|
||||||
)
|
)
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -17,6 +17,8 @@ cwtch.im/cwtch v0.14.3 h1:CKNBYGfKErtLDY3fUOyadTVNbI2JjOe+Ud/srydVAko=
|
||||||
cwtch.im/cwtch v0.14.3/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI=
|
cwtch.im/cwtch v0.14.3/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI=
|
||||||
cwtch.im/cwtch v0.14.4 h1:QbQVzrAqczAG5tGazQvRVfN7MyQPWVN5Fwv7MzCXZs4=
|
cwtch.im/cwtch v0.14.4 h1:QbQVzrAqczAG5tGazQvRVfN7MyQPWVN5Fwv7MzCXZs4=
|
||||||
cwtch.im/cwtch v0.14.4/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI=
|
cwtch.im/cwtch v0.14.4/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI=
|
||||||
|
cwtch.im/cwtch v0.14.5 h1:GY86C8UgqmuGh7ATR4C14hndc+c7PwPI8WH3l2iwnaQ=
|
||||||
|
cwtch.im/cwtch v0.14.5/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI=
|
||||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
|
filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
|
||||||
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=
|
||||||
|
|
|
@ -94,26 +94,25 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
||||||
if e.Data[event.Created] == event.True {
|
if e.Data[event.Created] == event.True {
|
||||||
profile.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants2.Picture, ImageToString(NewImage(RandomProfileImage(onion), TypeImageDistro)))
|
profile.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants2.Picture, ImageToString(NewImage(RandomProfileImage(onion), TypeImageDistro)))
|
||||||
}
|
}
|
||||||
if e.Data[event.Created] == event.True {
|
|
||||||
profile.SetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline, event.False)
|
|
||||||
eh.app.AddPeerPlugin(onion, plugins.CONNECTIONRETRY)
|
|
||||||
eh.app.AddPeerPlugin(onion, plugins.NETWORKCHECK)
|
|
||||||
|
|
||||||
// If the user has chosen to block unknown profiles
|
profile.SetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline, event.False)
|
||||||
// then explicitly configure the protocol engine to do so..
|
eh.app.AddPeerPlugin(onion, plugins.CONNECTIONRETRY)
|
||||||
if ReadGlobalSettings().BlockUnknownConnections {
|
eh.app.AddPeerPlugin(onion, plugins.NETWORKCHECK)
|
||||||
profile.BlockUnknownConnections()
|
|
||||||
} else {
|
|
||||||
// For completeness
|
|
||||||
profile.AllowUnknownConnections()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start up the Profile
|
// If the user has chosen to block unknown profiles
|
||||||
profile.Listen()
|
// then explicitly configure the protocol engine to do so..
|
||||||
profile.StartPeersConnections()
|
if ReadGlobalSettings().BlockUnknownConnections {
|
||||||
if _, err := groups.ExperimentGate(ReadGlobalSettings().Experiments); err == nil {
|
profile.BlockUnknownConnections()
|
||||||
profile.StartServerConnections()
|
} else {
|
||||||
}
|
// For completeness
|
||||||
|
profile.AllowUnknownConnections()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start up the Profile
|
||||||
|
profile.Listen()
|
||||||
|
profile.StartPeersConnections()
|
||||||
|
if _, err := groups.ExperimentGate(ReadGlobalSettings().Experiments); err == nil {
|
||||||
|
profile.StartServerConnections()
|
||||||
}
|
}
|
||||||
|
|
||||||
online, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline)
|
online, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline)
|
||||||
|
@ -409,6 +408,8 @@ func (eh *EventHandler) startHandlingPeer(onion string) {
|
||||||
eventBus.Subscribe(event.SendMessageToPeerError, q)
|
eventBus.Subscribe(event.SendMessageToPeerError, q)
|
||||||
eventBus.Subscribe(event.ServerStateChange, q)
|
eventBus.Subscribe(event.ServerStateChange, q)
|
||||||
eventBus.Subscribe(event.PeerStateChange, q)
|
eventBus.Subscribe(event.PeerStateChange, q)
|
||||||
|
eventBus.Subscribe(event.ChangePasswordSuccess, q)
|
||||||
|
eventBus.Subscribe(event.ChangePasswordError, q)
|
||||||
eventBus.Subscribe(event.NewRetValMessageFromPeer, q)
|
eventBus.Subscribe(event.NewRetValMessageFromPeer, q)
|
||||||
eventBus.Subscribe(event.ShareManifest, q)
|
eventBus.Subscribe(event.ShareManifest, q)
|
||||||
eventBus.Subscribe(event.ManifestSizeReceived, q)
|
eventBus.Subscribe(event.ManifestSizeReceived, q)
|
||||||
|
|
Reference in New Issue