From 4390c8369a2b377abb789b3c5eb6cd19708afe83 Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Mon, 25 Apr 2022 18:14:42 +0200 Subject: [PATCH] cleanup --- main.go | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index 50db2dd..b8f85b6 100644 --- a/main.go +++ b/main.go @@ -135,6 +135,12 @@ func main() { log.Fatal("No Ox support for chat rooms available.") case *flagOx && *flagListen: log.Fatal("No Ox support for receiving messages available.") + case *flagHttpUpload != "" && *flagInteractive: + log.Fatal("Interactive mode and http upload can't" + + " be used at the same time.") + case *flagHttpUpload != "" && *flagMessageFile != "": + log.Fatal("You can't send a message while using" + + " http upload.") } // Read recipients from command line and quit if none are specified. @@ -186,17 +192,6 @@ func main() { resource = "go-sendxmpp." + getShortID() } - if (*flagHttpUpload != "") && (*flagInteractive || (*flagMessageFile != "")) { - if *flagInteractive { - log.Fatal("Interactive mode and http upload can't" + - " be used at the same time.") - } - if *flagMessageFile != "" { - log.Fatal("You can't send a message while using" + - " http upload.") - } - } - // Timeout timeout := time.Duration(*flagTimeout * 1000000000)