on server import, connect #45
|
@ -105,9 +105,11 @@ func (gf *GroupFunctionality) HandleImportString(peer peer.CwtchPeer, importStri
|
||||||
// Server Key Bundles are prefixed with
|
// Server Key Bundles are prefixed with
|
||||||
bundle, err := base64.StdEncoding.DecodeString(importString[len(serverPrefix):])
|
bundle, err := base64.StdEncoding.DecodeString(importString[len(serverPrefix):])
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if err = peer.AddServer(string(bundle)); err != nil {
|
serverOnion, err := peer.AddServer(string(bundle))
|
||||||
|
if err != nil {
|
||||||
return features.ConstructResponse(importBundlePrefix, err.Error())
|
return features.ConstructResponse(importBundlePrefix, err.Error())
|
||||||
}
|
}
|
||||||
|
peer.JoinServer(serverOnion)
|
||||||
return features.ConstructResponse(importBundlePrefix, "success")
|
return features.ConstructResponse(importBundlePrefix, "success")
|
||||||
}
|
}
|
||||||
return features.ConstructResponse(importBundlePrefix, err.Error())
|
return features.ConstructResponse(importBundlePrefix, err.Error())
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go
|
||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cwtch.im/cwtch v0.13.2
|
cwtch.im/cwtch v0.13.3
|
||||||
git.openprivacy.ca/cwtch.im/server v1.3.3
|
git.openprivacy.ca/cwtch.im/server v1.3.3
|
||||||
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
|
||||||
|
|
10
go.sum
10
go.sum
|
@ -1,11 +1,5 @@
|
||||||
cwtch.im/cwtch v0.12.2 h1:I+ndKadCRCITw4SPbd+1cpRv+z/7iHjjTUv8OzRwTrE=
|
cwtch.im/cwtch v0.13.3 h1:YMqb18msXmBW7gHAn2X/QgljoDag/HgWe6qdz9OgwlY=
|
||||||
cwtch.im/cwtch v0.12.2/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM=
|
cwtch.im/cwtch v0.13.3/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM=
|
||||||
cwtch.im/cwtch v0.13.0 h1:9WhLG9czfyRceZnHSqfTAq0vfmDC/E20mziJb9+Skrg=
|
|
||||||
cwtch.im/cwtch v0.13.0/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM=
|
|
||||||
cwtch.im/cwtch v0.13.1 h1:k7CDr16ZLZ+uaRtic2Joooc8TzkO7BkgWXs8r9ilqDY=
|
|
||||||
cwtch.im/cwtch v0.13.1/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM=
|
|
||||||
cwtch.im/cwtch v0.13.2 h1:qbKTQOUryvJpTzIf5iT49x6iAmeNxiz0doNb5phYVEQ=
|
|
||||||
cwtch.im/cwtch v0.13.2/go.mod h1:QpTkQK7MqNt0dQK9/pBk5VpkvFhy6xuoxJIn401B8fM=
|
|
||||||
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=
|
||||||
git.openprivacy.ca/cwtch.im/server v1.3.1 h1:Kt4TnlGxGPk1KTjvs1cXtnFWDx+hYqu8w+2eIaqt+F4=
|
git.openprivacy.ca/cwtch.im/server v1.3.1 h1:Kt4TnlGxGPk1KTjvs1cXtnFWDx+hYqu8w+2eIaqt+F4=
|
||||||
|
|
Reference in New Issue