Remove deprecated flag resource.

v0.6
Martin Dosch 8 months ago
parent f9c3c4cd0a
commit b773131f9e
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

@ -9,6 +9,9 @@
- Remove unnecessary newlines after stanzas.
- Fix segfault when authentication fails due to invalid username or password.
## Removed
- Removed deprecated flag and config option `resource`.
## [v0.6.1] 2023-07-25
### Changed
- Properly close connection to server.

@ -27,7 +27,6 @@ type configuration struct {
jserver string
port string
password string
resource string
alias string
}
@ -79,10 +78,10 @@ func main() {
}
var (
err error
message, user, server, password, resource, alias string
oxPrivKey *crypto.Key
recipients []recipientsType
err error
message, user, server, password, alias string
oxPrivKey *crypto.Key
recipients []recipientsType
)
// Define command line flags.
@ -94,8 +93,6 @@ func main() {
flagPassword := getopt.StringLong("password", 'p', "", "Password for XMPP account.")
flagChatroom := getopt.BoolLong("chatroom", 'c', "Send message to a chatroom.")
flagDirectTLS := getopt.BoolLong("tls", 't', "Use direct TLS.")
flagResource := getopt.StringLong("resource", 'r', "", "Set resource. "+
"When sending to a chatroom this is used as 'alias'. DEPRECATED: Use --alias instead.")
flagAlias := getopt.StringLong("alias", 'a', "", "Set alias/nickname"+
"for chatrooms.")
flagFile := getopt.StringLong("file", 'f', "", "Set configuration file. (Default: "+
@ -180,7 +177,6 @@ func main() {
user = config.username
server = config.jserver
password = config.password
resource = config.resource
alias = config.alias
if config.port != "" {
server = net.JoinHostPort(server, fmt.Sprint(config.port))
@ -203,14 +199,6 @@ func main() {
}
switch {
// Use the resource as alias if no alias is specified otherwise but a resource is specified.
// Backward compat, will be removed when resource is removed.
case alias == "" && *flagAlias == "" && *flagResource != "":
alias = *flagResource
// Use the resource as alias if no alias is specified otherwise but a resource is specified.
// Backward compat, will be removed when resource is removed.
case alias == "" && *flagAlias == "" && resource != "":
alias = resource
// Use "go-sendxmpp" if no nick is specified via config or command line flag.
case alias == "" && *flagAlias == "":
alias = "go-sendxmpp"
@ -219,15 +207,6 @@ func main() {
alias = *flagAlias
}
// Overwrite resource if specified via command line flag.
if *flagResource != "" {
fmt.Println("Deprecated flag: --resource.")
resource = *flagResource
} else if resource == "" {
// Use "go-sendxmpp" plus a random string if no other resource is specified.
resource = "go-sendxmpp." + getShortID()
}
// Timeout
timeout := time.Duration(*flagTimeout) * time.Second
@ -255,7 +234,7 @@ func main() {
Host: server,
User: user,
DialTimeout: timeout,
Resource: resource,
Resource: "go-sendxmpp." + getShortID(),
Password: password,
// NoTLS doesn't mean that no TLS is used at all but that instead
// of using an encrypted connection to the server (direct TLS)

@ -120,9 +120,6 @@ func parseConfig(configPath string) (configuration, error) {
}
case "port:":
output.port = row[1]
case "resource:":
output.resource = row[1]
fmt.Println(configPath+":", "Deprecated option: resource.")
case "alias:":
output.alias = row[1]
default:

Loading…
Cancel
Save