|
|
@ -217,8 +217,18 @@ func main() {
|
|
|
|
// If no server part is specified in the username but a server is specified
|
|
|
|
// 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
|
|
|
|
// 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.
|
|
|
|
// best. This is for compatibility with the old perl sendxmpp config files.
|
|
|
|
|
|
|
|
var serverpart string
|
|
|
|
if !strings.Contains(user, "@") && server != "" {
|
|
|
|
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 {
|
|
|
|
switch {
|
|
|
|