From 87216279cae1d3b8a7fb13031dfd00ab0452fd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 5 Apr 2023 20:56:48 +0200 Subject: [PATCH] irc: display a warning if CTCP name in option `irc.ctcp.*` is not lower case --- po/cs.po | 8 +++++++- po/de.po | 8 +++++++- po/es.po | 8 +++++++- po/fr.po | 12 ++++++++++-- po/hu.po | 8 +++++++- po/it.po | 8 +++++++- po/ja.po | 8 +++++++- po/pl.po | 8 +++++++- po/pt.po | 8 +++++++- po/pt_BR.po | 8 +++++++- po/ru.po | 8 +++++++- po/sr.po | 8 +++++++- po/tr.po | 8 +++++++- po/weechat.pot | 8 +++++++- src/plugins/irc/irc-config.c | 18 ++++++++++++++++-- 15 files changed, 117 insertions(+), 17 deletions(-) diff --git a/po/cs.po b/po/cs.po index fe5590b86..20802f512 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -8488,6 +8488,12 @@ msgstr "buffer použitý pro zobrazení zprávy obdržené od IRC serveru" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: chyba vytváření \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/de.po b/po/de.po index 314236087..3c9ba2126 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-04-01 22:43+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German - Germany \n" @@ -10553,6 +10553,12 @@ msgstr "" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: Fehler beim Erstellen von \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/es.po b/po/es.po index 45eebe262..d4d98aac9 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -9151,6 +9151,12 @@ msgstr "buffer donde mostrar los mensajes recibidos desde el servidor IRC" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: error al crear \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/fr.po b/po/fr.po index 43d0905f1..b117a4105 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" -"PO-Revision-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" +"PO-Revision-Date: 2023-04-05 20:55+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -10367,6 +10367,14 @@ msgstr "tampon utilisé pour afficher le message reçu du serveur IRC" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s : erreur de création \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" +"%s%s : attention : le nom CTCP \"%s\" doit être en minuscules, l'option " +"\"irc.ctcp.%s\" ne fonctionnera pas" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/hu.po b/po/hu.po index a41a0e5e3..3354129bc 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -8016,6 +8016,12 @@ msgstr "" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s nincs elég memória az információs pult üzenethez\n" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/it.po b/po/it.po index 2cd4256b7..0b9762ddf 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -8858,6 +8858,12 @@ msgstr "buffer usato per visualizzare i messaggi ricevuti dal server IRC" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: errore nella creazione \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/ja.po b/po/ja.po index 0fa84c3c0..428f6cb3b 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \"%s\"" msgstr "%s%s: 作成中のエラー \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/pl.po b/po/pl.po index 1795afa77..87982393d 100644 --- a/po/pl.po +++ b/po/pl.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-27 22:02+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: Polish \n" @@ -10785,6 +10785,12 @@ msgstr "bufor używany do wyświetlania wiadomości otrzymanych od serwera IRC" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: błąd podczas tworzenia \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/pt.po b/po/pt.po index 828348b93..14d0da8dd 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -9739,6 +9739,12 @@ msgstr "buffer usado para mostrar mensagens recebidas do servidor IRC" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: erro ao criar \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/pt_BR.po b/po/pt_BR.po index e7c1b0798..90bc42e28 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -8523,6 +8523,12 @@ msgstr "buffer utilizado para exibir mensagem recebida do servidor IRC" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: erro ao criar \"%s\" => \"%s\"" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/ru.po b/po/ru.po index 5863c17bd..3a1f59a84 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -8046,6 +8046,12 @@ msgstr "" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s недостаточно памяти для сообщения в строке информации\n" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/sr.po b/po/sr.po index 14ff4c641..54d8babb8 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-27 22:15+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -10485,6 +10485,12 @@ msgstr "бафер који се користи за приказ поруке msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: грешка при креирању „%s” => „%s”" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/tr.po b/po/tr.po index df1f83a86..4339c1028 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -10750,6 +10750,12 @@ msgstr "" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "%s%s: \"%s\" => \"%s\" oluşturulurken hata" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/po/weechat.pot b/po/weechat.pot index bba8763f2..55b8d2f35 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-01 11:12+0200\n" +"POT-Creation-Date: 2023-04-05 20:55+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -7208,6 +7208,12 @@ msgstr "" msgid "%s%s: error creating \"%s\" => \"%s\"" msgstr "" +#, c-format +msgid "" +"%s%s: warning: the CTCP name \"%s\" must be lower case, the option \"irc." +"ctcp.%s\" will not work" +msgstr "" + msgid "" "format for CTCP reply or empty string for blocking CTCP (no reply), " "following variables are replaced: $version (WeeChat version), $compilation " diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index bc243b15f..aa6d4677c 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -1471,9 +1471,9 @@ irc_config_ctcp_create_option (const void *pointer, void *data, { struct t_config_option *ptr_option; int rc; - const char *default_value; + const char *default_value, *pos_name; + char *name_lower; static char empty_value[1] = { '\0' }; - const char *pos_name; /* make C compiler happy */ (void) pointer; @@ -1506,6 +1506,20 @@ irc_config_ctcp_create_option (const void *pointer, void *data, if (!default_value) default_value = empty_value; + name_lower = weechat_string_tolower (pos_name); + if (name_lower && (strcmp (pos_name, name_lower) != 0)) + { + weechat_printf ( + NULL, + _("%s%s: warning: the CTCP name \"%s\" must be " + "lower case, the option \"irc.ctcp.%s\" will " + "not work"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, pos_name, + option_name); + } + if (name_lower) + free (name_lower); + ptr_option = weechat_config_new_option ( config_file, section, option_name, "string",