1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

allow enabling / disabling carbons without being connected.

This commit is contained in:
Adam Ehlers Nyholm Thomsen 2015-05-17 13:29:08 +02:00
parent aeffca496c
commit 882ca85aca

View File

@ -3980,16 +3980,12 @@ cmd_history(gchar **args, struct cmd_help_t help)
gboolean gboolean
cmd_carbons(gchar **args, struct cmd_help_t help) 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, gboolean result = _cmd_set_boolean_preference(args[0], help,
"Message carbons preference", PREF_CARBONS); "Message carbons preference", PREF_CARBONS);
jabber_conn_status_t conn_status = jabber_get_connection_status();
if (conn_status == JABBER_CONNECTED) {
// enable carbons // enable carbons
if (strcmp(args[0], "on") == 0) { if (strcmp(args[0], "on") == 0) {
iq_enable_carbons(); iq_enable_carbons();
@ -3997,6 +3993,8 @@ cmd_carbons(gchar **args, struct cmd_help_t help)
else if (strcmp(args[0], "off") == 0){ else if (strcmp(args[0], "off") == 0){
iq_disable_carbons(); iq_disable_carbons();
} }
}
return result; return result;
} }