diff --git a/peer/connections/connectionsmanager.go b/peer/connections/connectionsmanager.go index 2602181..d9e2e15 100644 --- a/peer/connections/connectionsmanager.go +++ b/peer/connections/connectionsmanager.go @@ -3,10 +3,10 @@ package connections import ( "cwtch.im/cwtch/model" "cwtch.im/cwtch/protocol" + "git.openprivacy.ca/openprivacy/libricochet-go/application" "sync" "time" - "git.openprivacy.ca/openprivacy/libricochet-go/application" - ) +) // Manager encapsulates all the logic necessary to manage outgoing peer and server connections. type Manager struct { diff --git a/peer/connections/peerpeerconnection.go b/peer/connections/peerpeerconnection.go index 29b08a7..aac76d1 100644 --- a/peer/connections/peerpeerconnection.go +++ b/peer/connections/peerpeerconnection.go @@ -5,12 +5,12 @@ import ( "cwtch.im/cwtch/peer/peer" "cwtch.im/cwtch/protocol" "git.openprivacy.ca/openprivacy/libricochet-go" + "git.openprivacy.ca/openprivacy/libricochet-go/application" "git.openprivacy.ca/openprivacy/libricochet-go/channels" "git.openprivacy.ca/openprivacy/libricochet-go/connection" "git.openprivacy.ca/openprivacy/libricochet-go/identity" "log" "time" - "git.openprivacy.ca/openprivacy/libricochet-go/application" ) // PeerPeerConnection encapsulates a single outgoing Peer->Peer connection @@ -76,6 +76,7 @@ func (ppc *PeerPeerConnection) SendPacket(data []byte) { }) } +// DoOnChannel performs an operation on the requested channel func (ppc *PeerPeerConnection) DoOnChannel(ctype string, direction channels.Direction, doSomethingWith func(channel *channels.Channel)) { ppc.WaitTilAuthenticated() ppc.connection.Do(func() error { diff --git a/peer/connections/peerpeerconnection_test.go b/peer/connections/peerpeerconnection_test.go index eab486c..8106648 100644 --- a/peer/connections/peerpeerconnection_test.go +++ b/peer/connections/peerpeerconnection_test.go @@ -6,6 +6,7 @@ import ( "cwtch.im/cwtch/peer/peer" "cwtch.im/cwtch/protocol" "git.openprivacy.ca/openprivacy/libricochet-go" + "git.openprivacy.ca/openprivacy/libricochet-go/application" "git.openprivacy.ca/openprivacy/libricochet-go/channels" "git.openprivacy.ca/openprivacy/libricochet-go/connection" "git.openprivacy.ca/openprivacy/libricochet-go/identity" @@ -81,7 +82,7 @@ func TestPeerPeerConnection(t *testing.T) { profile := model.GenerateNewProfile("alice") hostname := identity.Hostname() - ppc := NewPeerPeerConnection("127.0.0.1:5452|"+hostname, profile, nil) + ppc := NewPeerPeerConnection("127.0.0.1:5452|"+hostname, profile, nil, application.ApplicationInstanceFactory{}) tp := new(TestPeer) tp.Init() diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index 07ff5d6..bfd15fd 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -42,7 +42,7 @@ type cwtchPeer struct { salt [128]byte dataHandler func(string, []byte) []byte //handlers map[string]func(*application.ApplicationInstance) func() channels.Handler - aif application.ApplicationInstanceFactory + aif application.ApplicationInstanceFactory } // CwtchPeer provides us with a way of testing systems built on top of cwtch without having to