More perl sendxmpp config compatibility.

no-tls
Martin Dosch 4 months ago
parent a3cd1fe0a9
commit 459e40e9a4
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

@ -217,8 +217,18 @@ func main() {
// If no server part is specified in the username but a server is specified
// just assume the server is identical to the server part and hope for the
// best. This is for compatibility with the old perl sendxmpp config files.
var serverpart string
if !strings.Contains(user, "@") && server != "" {
user = user + "@" + server
// Remove port if server contains it.
if strings.Contains(server, ":") {
serverpart, _, err = net.SplitHostPort(server)
if err != nil {
log.Fatal(err)
}
} else {
serverpart = server
}
user = user + "@" + serverpart
}
switch {

Loading…
Cancel
Save