diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-02-10 14:52:42 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-02-10 14:52:42 +0100 |
commit | dd8086772d274542a28b7af045572933f0b6ac7d (patch) | |
tree | c9a8d895967ab68731ad01ac68e334ce1fc96c65 /src/command | |
parent | c2d70a071fb107a98f9b057eab4e5021f0eb7187 (diff) | |
download | profani-tty-dd8086772d274542a28b7af045572933f0b6ac7d.tar.gz |
xep-0308: create setting to toggle lmc
and print settings if only `/correction` is run.
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/cmd_defs.c | 2 | ||||
-rw-r--r-- | src/command/cmd_funcs.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 1563bf73..982d81f6 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2363,7 +2363,7 @@ static struct cmd_t command_defs[] = }, { "/correction", - parse_args, 1, 1, &cons_correction_setting, + parse_args, 1, 2, &cons_correction_setting, CMD_NOSUBFUNCS CMD_MAINFUNC(cmd_correction) CMD_TAGS( diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 1870429d..70a6dcc0 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -8657,15 +8657,17 @@ cmd_correction(ProfWin *window, const char *const command, gchar **args) { // enable/disable if (g_strcmp0(args[0], "on") == 0) { - prefs_set_boolean(PREF_BOOKMARK_INVITE, TRUE); + _cmd_set_boolean_preference(args[0], command, "Last Message Correction", PREF_CORRECTION_ALLOW); + caps_add_feature(XMPP_FEATURE_LAST_MESSAGE_CORRECTION); return TRUE; } else if (g_strcmp0(args[0], "off") == 0) { - prefs_set_boolean(PREF_BOOKMARK_INVITE, FALSE); + _cmd_set_boolean_preference(args[0], command, "Last Message Correction", PREF_CORRECTION_ALLOW); + caps_remove_feature(XMPP_FEATURE_LAST_MESSAGE_CORRECTION); return TRUE; } // char - if (g_strcmp(args[0], "char") == 0) { + if (g_strcmp0(args[0], "char") == 0) { if (args[1] == NULL) { cons_bad_cmd_usage(command); } else if (strlen(args[1]) != 1) { |