about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index c294a16b..2abb2d51 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -113,8 +113,6 @@ cmd_connect(gchar **args, struct cmd_help_t help)
             }
         }
 
-        options_destroy(options);
-
         char *user = args[0];
         if(!user){
             if(def){
@@ -135,6 +133,8 @@ cmd_connect(gchar **args, struct cmd_help_t help)
                 account->password = ui_ask_password();
             }
             cons_show("Connecting with account %s as %s", account->name, jid);
+            if(g_hash_table_contains(options, "port") || g_hash_table_contains(options, "server"))
+                cons_show("Ignoring extra connect options. Please set them with /account set");
             conn_status = jabber_connect_with_account(account);
             account_free(account);
         } else {
@@ -151,6 +151,8 @@ cmd_connect(gchar **args, struct cmd_help_t help)
             log_info("Connection attempt for %s failed", jid);
         }
 
+        options_destroy(options);
+
         free(jid);
 
         result = TRUE;