|
|
|
@ -5,7 +5,6 @@
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
"net"
|
|
|
|
|
"strings"
|
|
|
|
@ -34,7 +33,7 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
|
|
|
|
options.Host = net.JoinHostPort(adr.Target, fmt.Sprint(adr.Port))
|
|
|
|
|
// Connect to server
|
|
|
|
|
client, err := options.NewClient()
|
|
|
|
|
if errors.Unwrap(err) == nil {
|
|
|
|
|
if err == nil {
|
|
|
|
|
return client, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -53,7 +52,7 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
|
|
|
|
}
|
|
|
|
|
// Connect to server
|
|
|
|
|
client, err := options.NewClient()
|
|
|
|
|
if errors.Unwrap(err) == nil {
|
|
|
|
|
if err == nil {
|
|
|
|
|
return client, nil
|
|
|
|
|
}
|
|
|
|
|
return client, fmt.Errorf("failed to connect to server: %w", err)
|
|
|
|
|