Simplify connection code.

This commit is contained in:
Martin Dosch 2023-06-06 21:36:28 +02:00
parent 28521a16aa
commit 4664c02cbc
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

View File

@ -49,11 +49,11 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
options.StartTLS = true
options.Host = net.JoinHostPort(server, "5222")
}
// Connect to server
client, err := options.NewClient()
return client, err
}
// Connect to server
client, err := options.NewClient()
return client, err
if err == nil {
return client, nil
}
return client, fmt.Errorf("failed to connect to server: %w", err)
}