From b6c304ac87f0d40ab2a4ac3fac49b078cb9d77ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 15 Jun 2019 08:14:22 +0200 Subject: [PATCH] irc: fix display of enabled/disabled client capabilities received in command CAP ACK (closes #151) --- ChangeLog.adoc | 1 + po/cs.po | 10 +++++- po/de.po | 10 +++++- po/es.po | 10 +++++- po/fr.po | 12 +++++-- po/hu.po | 10 +++++- po/it.po | 10 +++++- po/ja.po | 10 +++++- po/pl.po | 10 +++++- po/pt.po | 10 +++++- po/pt_BR.po | 10 +++++- po/ru.po | 10 +++++- po/tr.po | 10 +++++- po/weechat.pot | 10 +++++- src/plugins/irc/irc-protocol.c | 61 ++++++++++++++++++++++++++++------ 15 files changed, 169 insertions(+), 25 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 832fb2bd8..2a35cf730 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -26,6 +26,7 @@ Bug fixes:: * core: replace char "," by "~" in color codes to separate foreground from background (issue #1264) * alias: remove default aliases /AME and /AMSG (issue #1355) + * irc: fix display of enabled/disabled client capabilities received in command CAP ACK (issue #151) [[v2.5]] == Version 2.5 (2019-06-06) diff --git a/po/cs.po b/po/cs.po index 99e170b28..8438941b9 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-13 21:31+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -8938,10 +8938,18 @@ msgstr "%s%s: schopnost klienta, server podporuje: %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s%s: schopnost klienta, povoleno: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s%s: schopnost klienta, povoleno: %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "%s%s: schopnost klienta, povoleno: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s%s: schopnost klienta, povoleno: %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "%s%s: vlastnost klienta, odepřena: %s" diff --git a/po/de.po b/po/de.po index 25c59d5f7..a0c550d25 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-06-04 20:21+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -10707,10 +10707,18 @@ msgstr "%s%s: Clientfähigkeiten, Server unterstützt: %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s%s: Clientfähigkeiten (CAP), aktuell aktiviert: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s%s: Clientfähigkeit, aktiviert: %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "%s%s: Clientfähigkeit, aktiviert: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s%s: Clientfähigkeit, aktiviert: %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "%s%s: Clientfähigkeit, abgewiesen: %s" diff --git a/po/es.po b/po/es.po index 1a061efab..f3e523917 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-13 21:31+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -9252,10 +9252,18 @@ msgstr "%s%s: capabilidad del cliente, el servidor soporta: %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s%s: capabilidad del cliente, habilitado: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s%s: capabilidad del cliente, habilitado: %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "%s%s: capabilidad del cliente, habilitado: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s%s: capabilidad del cliente, habilitado: %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "%s%s: capabilidad del cliente, rechazada: %s" diff --git a/po/fr.po b/po/fr.po index e53eb9a0b..bd97f8904 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: 2019-06-12 18:25+0200\n" -"PO-Revision-Date: 2019-06-12 18:27+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" +"PO-Revision-Date: 2019-06-15 08:07+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -10461,10 +10461,18 @@ msgstr "%s%s : client capability, le serveur supporte : %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s%s : client capability, actuellement activé : %s" +#, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s%s : client capability, activé : %s, désactivé : %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "%s%s : client capability, activé : %s" +#, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s%s : client capability, désactivé : %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "%s%s : client capability, refusé : %s" diff --git a/po/hu.po b/po/hu.po index 64a914d95..b6feb2bdc 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-13 21:31+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -8347,10 +8347,18 @@ msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" msgid "%s%s: client capability, currently enabled: %s" msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + #, fuzzy, c-format msgid "%s%s: client capability, refused: %s" msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" diff --git a/po/it.po b/po/it.po index 448900302..959123b60 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-13 21:31+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -9441,10 +9441,18 @@ msgstr "%s%s: capacità del client, il server supporta: %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s%s: capacità del client, abilitata: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s%s: capacità del client, abilitata: %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "%s%s: capacità del client, abilitata: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s%s: capacità del client, abilitata: %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "%s%s: capacità del client, rifiutata: %s" diff --git a/po/ja.po b/po/ja.po index 71a07e45d..d1dc40c1d 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-26 09:00+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -10225,10 +10225,18 @@ msgstr "%s%s: możliwości klienta, serwer wspiera: %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s%s: możliwości klienta, aktualnie włączone: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s%s: możliwości klienta, włączone: %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "%s%s: możliwości klienta, włączone: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s%s: możliwości klienta, włączone: %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "%s%s: możliwości klienta, odrzucone: %s" diff --git a/po/pt.po b/po/pt.po index 584258350..55a28f0fa 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-13 21:32+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -9896,10 +9896,18 @@ msgstr "%s%s: capacidade do cliente, o servidor suporta: %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s%s: capacidade do cliente, ativado atualmente: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s%s: capacidade do cliente, ativado: %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "%s%s: capacidade do cliente, ativado: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s%s: capacidade do cliente, ativado: %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "%s%s: capacidade do cliente, recusado: %s" diff --git a/po/pt_BR.po b/po/pt_BR.po index 50c9346f9..8740881f5 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-13 21:32+0200\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -8776,10 +8776,18 @@ msgstr "%s: script removido: %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s: script removido: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s: script removido: %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s: script removido: %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "" diff --git a/po/ru.po b/po/ru.po index d326a57af..54de1b604 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-13 21:32+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -8383,10 +8383,18 @@ msgstr "Не могу записать лог-файл \"%s\"\n" msgid "%s%s: client capability, currently enabled: %s" msgstr "Не могу записать лог-файл \"%s\"\n" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "Не могу записать лог-файл \"%s\"\n" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "Не могу записать лог-файл \"%s\"\n" + #, fuzzy, c-format msgid "%s%s: client capability, refused: %s" msgstr "Не могу записать лог-файл \"%s\"\n" diff --git a/po/tr.po b/po/tr.po index 30e9187bf..919095fc1 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2019-05-13 21:32+0200\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -7577,10 +7577,18 @@ msgstr "%s: betik kaldırıldı: %s" msgid "%s%s: client capability, currently enabled: %s" msgstr "%s: betik kaldırıldı: %s" +#, fuzzy, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "%s: betik kaldırıldı: %s" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "" +#, fuzzy, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "%s: betik kaldırıldı: %s" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index 07b6f54e7..a65359341 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: 2019-06-12 18:25+0200\n" +"POT-Creation-Date: 2019-06-15 08:06+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -7440,10 +7440,18 @@ msgstr "" msgid "%s%s: client capability, currently enabled: %s" msgstr "" +#, c-format +msgid "%s%s: client capability, enabled: %s, disabled: %s" +msgstr "" + #, c-format msgid "%s%s: client capability, enabled: %s" msgstr "" +#, c-format +msgid "%s%s: client capability, disabled: %s" +msgstr "" + #, c-format msgid "%s%s: client capability, refused: %s" msgstr "" diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 4b13ac928..d9e160843 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -478,7 +478,7 @@ IRC_PROTOCOL_CALLBACK(cap) { char *ptr_caps, **caps_supported, **caps_added, **caps_removed; char **caps_enabled, *pos_value, *str_name, **str_caps; - char str_msg_auth[512]; + char str_msg_auth[512], **str_caps_enabled, **str_caps_disabled; int num_caps_supported, num_caps_added, num_caps_removed; int num_caps_enabled, sasl_to_do, sasl_mechanism; int i, timeout, last_reply; @@ -650,11 +650,11 @@ IRC_PROTOCOL_CALLBACK(cap) if (argc > 4) { ptr_caps = (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]; - weechat_printf_date_tags ( - server->buffer, date, NULL, - _("%s%s: client capability, enabled: %s"), - weechat_prefix ("network"), IRC_PLUGIN_NAME, ptr_caps); + sasl_to_do = 0; + str_caps_enabled = weechat_string_dyn_alloc (128); + str_caps_disabled = weechat_string_dyn_alloc (128); + caps_supported = weechat_string_split ( ptr_caps, " ", @@ -667,17 +667,56 @@ IRC_PROTOCOL_CALLBACK(cap) { for (i = 0; i < num_caps_supported; i++) { - weechat_hashtable_set (server->cap_list, - caps_supported[i], NULL); - - if (strcmp (caps_supported[i], "sasl") == 0) + if (caps_supported[i][0] == '-') { - sasl_to_do = 1; - break; + if (*str_caps_disabled[0]) + weechat_string_dyn_concat (str_caps_disabled, " "); + weechat_string_dyn_concat (str_caps_disabled, + caps_supported[i] + 1); + } + else + { + if (*str_caps_enabled[0]) + weechat_string_dyn_concat (str_caps_enabled, " "); + weechat_string_dyn_concat (str_caps_enabled, + caps_supported[i]); + + weechat_hashtable_set (server->cap_list, + caps_supported[i], NULL); + + if (strcmp (caps_supported[i], "sasl") == 0) + sasl_to_do = 1; } } weechat_string_free_split (caps_supported); } + if (*str_caps_enabled[0] && *str_caps_disabled[0]) + { + weechat_printf_date_tags ( + server->buffer, date, NULL, + _("%s%s: client capability, enabled: %s, disabled: %s"), + weechat_prefix ("network"), IRC_PLUGIN_NAME, + *str_caps_enabled, *str_caps_disabled); + } + else if (*str_caps_enabled[0]) + { + weechat_printf_date_tags ( + server->buffer, date, NULL, + _("%s%s: client capability, enabled: %s"), + weechat_prefix ("network"), IRC_PLUGIN_NAME, + *str_caps_enabled); + } + else if (*str_caps_disabled[0]) + { + weechat_printf_date_tags ( + server->buffer, date, NULL, + _("%s%s: client capability, disabled: %s"), + weechat_prefix ("network"), IRC_PLUGIN_NAME, + *str_caps_disabled); + } + weechat_string_dyn_free (str_caps_enabled, 1); + weechat_string_dyn_free (str_caps_disabled, 1); + if (sasl_to_do) { sasl_mechanism = IRC_SERVER_OPTION_INTEGER(