diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-07-10 15:16:34 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-07-10 15:16:34 +0200 |
commit | 95ab7ee062b9fbeea73b90f69c6fef3325f880c9 (patch) | |
tree | 7caea5336c4aa47b9b6b71d5c8102d7804c008cb /src/command/cmd_funcs.c | |
parent | 10d771f3d1994cc450e96f25d45a3bbf297fb48f (diff) | |
download | profani-tty-95ab7ee062b9fbeea73b90f69c6fef3325f880c9.tar.gz |
Setting: only write in console upon muc mention
`/console muc mention` additionally to `first|none|all`. Fix https://github.com/profanity-im/profanity/issues/1371
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r-- | src/command/cmd_funcs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index b0b00769..5c01cedc 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -5153,15 +5153,19 @@ cmd_beep(ProfWin* window, const char* const command, gchar** args) gboolean cmd_console(ProfWin* window, const char* const command, gchar** args) { - if ((g_strcmp0(args[0], "chat") != 0) && (g_strcmp0(args[0], "muc") != 0) && (g_strcmp0(args[0], "private") != 0)) { + gboolean isMuc = (g_strcmp0(args[0], "muc") == 0) ; + + if ((g_strcmp0(args[0], "chat") != 0) && !isMuc && (g_strcmp0(args[0], "private") != 0)) { cons_bad_cmd_usage(command); return TRUE; } - char* setting = args[1]; + gchar* setting = args[1]; if ((g_strcmp0(setting, "all") != 0) && (g_strcmp0(setting, "first") != 0) && (g_strcmp0(setting, "none") != 0)) { - cons_bad_cmd_usage(command); - return TRUE; + if ( !(isMuc && (g_strcmp0(setting, "mention") == 0))) { + cons_bad_cmd_usage(command); + return TRUE; + } } if (g_strcmp0(args[0], "chat") == 0) { |