diff options
| author | Michael Vetter <jubalh@iodoru.org> | 2020-02-21 14:51:19 +0100 |
|---|---|---|
| committer | Michael Vetter <jubalh@iodoru.org> | 2020-02-21 14:51:19 +0100 |
| commit | 669de0ca521b8aada5be6cfa52fe5f4416ca84a1 (patch) | |
| tree | d42d2b44cfc7645ed63ca4c2f4f292de5137e16f /src/command | |
| parent | 2a952cb4c5f17caf5b58d7c895811669a9e361bd (diff) | |
| download | profani-tty-669de0ca521b8aada5be6cfa52fe5f4416ca84a1.tar.gz | |
Improve setting encryption char error handling
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/cmd_funcs.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index f32deef0..f0468cdd 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -7132,8 +7132,11 @@ cmd_pgp(ProfWin *window, const char *const command, gchar **args) cons_bad_cmd_usage(command); return TRUE; } else if (g_utf8_strlen(args[1], 4) == 1) { - prefs_set_pgp_char(args[1]); - cons_show("PGP char set to %s.", args[1]); + if (prefs_set_pgp_char(args[1])) { + cons_show("PGP char set to %s.", args[1]); + } else { + cons_show_error("Could not set PGP char: %s.", args[1]); + } return TRUE; } cons_bad_cmd_usage(command); @@ -7369,8 +7372,11 @@ cmd_otr_char(ProfWin *window, const char *const command, gchar **args) cons_bad_cmd_usage(command); return TRUE; } else if (g_utf8_strlen(args[1], 4) == 1) { - prefs_set_otr_char(args[1]); - cons_show("OTR char set to %s.", args[1]); + if (prefs_set_otr_char(args[1])) { + cons_show("OTR char set to %s.", args[1]); + } else { + cons_show_error("Could not set OTR char: %s.", args[1]); + } return TRUE; } cons_bad_cmd_usage(command); @@ -8272,8 +8278,11 @@ cmd_omemo_char(ProfWin *window, const char *const command, gchar **args) cons_bad_cmd_usage(command); return TRUE; } else if (g_utf8_strlen(args[1], 4) == 1) { - prefs_set_omemo_char(args[1]); - cons_show("OMEMO char set to %s.", args[1]); + if (prefs_set_omemo_char(args[1])) { + cons_show("OMEMO char set to %s.", args[1]); + } else { + cons_show_error("Could not set OMEMO char: %s.", args[1]); + } return TRUE; } cons_bad_cmd_usage(command); |