summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-04-05 21:04:54 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-04-05 21:04:54 +0200
commit5c801f2741dec493bf2801203f9d0937c1f91cc4 (patch)
tree5de3cb7019dcb404bc6b63065d66fc2c8ad2af7a /src
parent87216279cae1d3b8a7fb13031dfd00ab0452fd35 (diff)
downloadweechat-5c801f2741dec493bf2801203f9d0937c1f91cc4.zip
irc: display a warning if command name in option `irc.msgbuffer.*` is not lower case
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-config.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index aa6d4677c..bbae1a381 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -1406,6 +1406,7 @@ irc_config_msgbuffer_create_option (const void *pointer, void *data,
const char *option_name, const char *value)
{
struct t_config_option *ptr_option;
+ char *name_lower;
int rc;
/* make C compiler happy */
@@ -1432,6 +1433,20 @@ irc_config_msgbuffer_create_option (const void *pointer, void *data,
{
if (value)
{
+ name_lower = weechat_string_tolower (option_name);
+ if (name_lower && (strcmp (option_name, name_lower) != 0))
+ {
+ weechat_printf (
+ NULL,
+ _("%s%s: warning: the command name \"%s\" must be "
+ "lower case, the option \"irc.msgbuffer.%s\" will "
+ "not work"),
+ weechat_prefix ("error"), IRC_PLUGIN_NAME,
+ option_name, option_name);
+ }
+ if (name_lower)
+ free (name_lower);
+
ptr_option = weechat_config_new_option (
config_file, section,
option_name, "integer",