Skip to content
Snippets Groups Projects
Commit 6855da0c authored by Josh Brooks's avatar Josh Brooks
Browse files

Revert fix for already established connection

parent ed63be57
No related branches found
No related tags found
2 merge requests!510Release,!275Implement connection CLI
......@@ -31,11 +31,11 @@ import (
const terminator = ";"
// Error constant strings. Any changes to these should go over usages of the
// affected messages in other applications (if applicable)
const (
// ErrChannelExists is a message returned in state.Request when an
// authenticated channel exists between the partner and me.
// Note that modifications to this should go over usages of this message
// in other packages (if applicable).
ErrChannelExists = "Authenticated channel already established with partner"
)
......
......@@ -8,7 +8,6 @@ package connect
import (
"io"
"strings"
"sync/atomic"
"time"
......@@ -96,16 +95,6 @@ func Connect(recipient contact.Contact, messenger *xxdk.E2e,
// Perform the auth request
_, err := messenger.GetAuth().Request(recipient, nil)
if err != nil {
// Return connection if a partnership already exists
if strings.Contains(err.Error(), auth.ErrChannelExists) {
newPartner, err := messenger.GetE2E().GetPartner(recipient.ID)
if err != nil {
return nil, err
}
conn := BuildConnection(newPartner,
messenger.GetE2E(), messenger.GetAuth(), p)
return conn, nil
}
return nil, err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment