From 10feec99c8d66776388019688af10422b549c366 Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Tue, 20 Feb 2024 20:45:43 +0100 Subject: [PATCH] Better compatibility with perl sendxmpp config files. --- CHANGELOG.md | 1 + main.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d5d4a4..4c275b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## UNRELEASED ### Changed - Properly handle lost connection. +- Better compatibility with perl sendxmpp config files. ## [v0.8.3] 2024-02-17 ### Changed diff --git a/main.go b/main.go index 45051c9..c65913c 100644 --- a/main.go +++ b/main.go @@ -217,6 +217,12 @@ func main() { if *flagPassword != "" { password = *flagPassword } + // 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. + if !strings.Contains(user, "@") && server != "" { + user = user + "@" + server + } switch { // Use "go-sendxmpp" if no nick is specified via config or command line flag.