about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-05-17 22:28:12 +0100
committerJames Booth <boothj5@gmail.com>2015-05-17 22:28:12 +0100
commit34d9b2b272ca2c35ab40dd181f2ea5a52e1dbc68 (patch)
tree46ee6f99192baa7db7e87b6c5c0b598ab26763a2 /src
parent7f861b7743a580bfd052798a21ef494ec6770e48 (diff)
parentadae6bb4a5dc2356ad208742cbe764765869733d (diff)
downloadprofani-tty-34d9b2b272ca2c35ab40dd181f2ea5a52e1dbc68.tar.gz
Merge branch 'master' into openpgp
Diffstat (limited to 'src')
-rw-r--r--src/command/commands.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index dc7db4a3..b06b1a13 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -3991,23 +3991,21 @@ cmd_history(gchar **args, struct cmd_help_t help)
 gboolean
 cmd_carbons(gchar **args, struct cmd_help_t help)
 {
-    jabber_conn_status_t conn_status = jabber_get_connection_status();
-
-    if (conn_status != JABBER_CONNECTED) {
-        cons_show("You are not currently connected.");
-        return TRUE;
-    }
-
     gboolean result = _cmd_set_boolean_preference(args[0], help,
         "Message carbons preference", PREF_CARBONS);
 
-    // enable carbons
-    if (strcmp(args[0], "on") == 0) {
-        iq_enable_carbons();
-    }
-    else if (strcmp(args[0], "off") == 0){
-        iq_disable_carbons();
+    jabber_conn_status_t conn_status = jabber_get_connection_status();
+
+    if (conn_status == JABBER_CONNECTED) {
+        // enable carbons
+        if (strcmp(args[0], "on") == 0) {
+            iq_enable_carbons();
+        }
+        else if (strcmp(args[0], "off") == 0){
+            iq_disable_carbons();
+        }
     }
+
     return result;
 }
 
@@ -4477,4 +4475,4 @@ gint _compare_commands(Command *a, Command *b)
     g_free(key_b);
 
     return result;
-}
\ No newline at end of file
+}