Don't require the `--jserver` command line flag.

Just assume the JIDs domain part to be the server.
The mattn/go-xmpp lib will find the appropriate server
to connect to by resolving the xmpp-client SRV record.
raw
Martin Dosch 3 years ago
parent 24a13d3c61
commit aba6bb2099

@ -260,8 +260,8 @@ func main() {
recipients[i] = validatedJid
}
// Read configuration file if user, server or password is not specified.
if *flagUser == "" || *flagServer == "" || *flagPassword == "" {
// Read configuration file if user or password is not specified.
if *flagUser == "" || *flagPassword == "" {
// Read configuration from file.
config, err := parseConfig(*flagFile)
if err != nil {
@ -286,6 +286,11 @@ func main() {
server = *flagServer
}
// Use the JIDs server part if no server is specified.
if server == "" {
server = strings.Split(user, "@")[1]
}
// Overwrite password if specified via command line flag.
if *flagPassword != "" {
password = *flagPassword

Loading…
Cancel
Save