diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-06-19 17:50:07 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-06-19 18:22:49 +0200 |
commit | ef318cb70c3db60d7647fce3c498813a87c43b46 (patch) | |
tree | 2fcbbb16556755e9189db106de91cc224fc8ff6a | |
parent | 947f73bd506deec427e7393c6e2c696424415780 (diff) | |
download | weechat-ef318cb70c3db60d7647fce3c498813a87c43b46.zip |
irc: enable all capabilities by default (supported by both server and WeeChat) (closes #320)
Capabilities can be excluded with the format: "*,!account-*,!extended-join".
29 files changed, 306 insertions, 105 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 6d1efdb4e..5e84ccb9d 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -21,6 +21,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] New features:: * core: add option "certs" in command /debug + * irc: enable all capabilities by default (if supported by server and WeeChat), change default value of option irc.server_default.capabilities to "*" (issue #320) * irc: add options irc.look.display_account_message and irc.look.display_extended_join (issue #320) * irc: add command /setname, add support of message and capability "setname" (issue #1653) * irc: always set realname in nicks even when extended-join capability is not enabled (issue #1653) diff --git a/ReleaseNotes.adoc b/ReleaseNotes.adoc index 6bae415f7..2e69a0453 100644 --- a/ReleaseNotes.adoc +++ b/ReleaseNotes.adoc @@ -20,7 +20,50 @@ https://weechat.org/files/changelog/ChangeLog-devel.html[ChangeLog] [[v3.3]] == Version 3.3 (under dev) -[[v3.2_irc_sasl_blowfish_aes]] +[[v3.3_irc_default_capabilities]] +=== IRC default capabilities + +All supported capabilities are now enabled by default if the server support +them: + +* account-notify +* away-notify +* cap-notify +* chghost +* extended-join +* invite-notify +* multi-prefix +* server-time +* setname +* userhost-in-names + +Two new options have been added and enabled by default to customize the behavior +of capabilities "account-notify" and "extended-join": + +* _irc.look.display_account_message_: display ACCOUNT messages received +* _irc.look.display_extended_join_: display extended join info in the JOIN + messages: account name and real name + +The default value of option _irc.server_default.capabilities_ is now `*` which +means that all capabilities supported by both WeeChat and the server are enabled +by default. + +After upgrade, to enable all capabilities and remove custom capabilities you +have set, you can do: + +---- +/set irc.server_default.capabilities "*" +/unset irc.server.example.capabilities +---- + +You can also explicitly disable some capabilities with this syntax +(see `/help irc.server_default.capabilities`): + +---- +/set irc.server_default.capabilities "*,!away-notify,!extended-join" +---- + +[[v3.3_irc_sasl_blowfish_aes]] === Drop support of SASL DH-BLOWFISH and DH-AES mechanisms The SASL mechanisms DH-BLOWFISH and DH-AES have been removed, because they diff --git a/doc/de/includes/autogen_user_options.de.adoc b/doc/de/includes/autogen_user_options.de.adoc index 882ae0feb..7594c50eb 100644 --- a/doc/de/includes/autogen_user_options.de.adoc +++ b/doc/de/includes/autogen_user_options.de.adoc @@ -2677,10 +2677,10 @@ ** Standardwert: `+25+` * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** Beschreibung: pass:none[durch Kommata getrennte Liste von erweiterten Client-Fähigkeiten ("client capabilities"), welche vom Server angeboten und genutzt werden sollen (siehe /help cap um eine Liste von Fähigkeiten zu erhalten die von WeeChat unterstützt werden) (Beispiel: "away-notify,multi-prefix")] +** Beschreibung: pass:none[comma-separated list of client capabilities to enable for server if they are available (see /help cap for a list of capabilities supported by WeeChat); "*" enables all capabilities by default (supported by both server and WeeChat); wildcard "*" is allowed; a capability beginning with "!" is excluded (example: "*,!account-*,!extended-join")] ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette -** Standardwert: `+""+` +** Standardwert: `+"*"+` * [[option_irc.server_default.charset_message]] *irc.server_default.charset_message* ** Beschreibung: pass:none[Teil der IRC Nachricht (empfangen oder gesendet) die zum Zielzeichensatz dekodiert/kodiert werden soll; message = die komplette IRC Nachricht (Standard), channel = beginnend mit dem Kanalnamen (sofern dieser gefunden wird, ansonsten Fallback auf text), text = beginnend mit dem Nachrichtentext (dieser Wert sollte ausprobiert werden, falls es Probleme bei der Kodierung des Kanalnamens geben sollte)] diff --git a/doc/en/includes/autogen_user_options.en.adoc b/doc/en/includes/autogen_user_options.en.adoc index 6f2eb6d80..56226b24d 100644 --- a/doc/en/includes/autogen_user_options.en.adoc +++ b/doc/en/includes/autogen_user_options.en.adoc @@ -2677,10 +2677,10 @@ ** default value: `+25+` * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** description: pass:none[comma-separated list of client capabilities to enable for server if they are available (see /help cap for a list of capabilities supported by WeeChat) (example: "away-notify,multi-prefix")] +** description: pass:none[comma-separated list of client capabilities to enable for server if they are available (see /help cap for a list of capabilities supported by WeeChat); "*" enables all capabilities by default (supported by both server and WeeChat); wildcard "*" is allowed; a capability beginning with "!" is excluded (example: "*,!account-*,!extended-join")] ** type: string ** values: any string -** default value: `+""+` +** default value: `+"*"+` * [[option_irc.server_default.charset_message]] *irc.server_default.charset_message* ** description: pass:none[part of the IRC message (received or sent) which is decoded/encoded to the target charset; message = the whole IRC message (default), channel = starting from the channel name only (if found, with fallback on text), text = starting from the text only (you should try this value if you have issues with the channel name encoding)] diff --git a/doc/fr/includes/autogen_user_options.fr.adoc b/doc/fr/includes/autogen_user_options.fr.adoc index db5508e3d..5bf66870f 100644 --- a/doc/fr/includes/autogen_user_options.fr.adoc +++ b/doc/fr/includes/autogen_user_options.fr.adoc @@ -2677,10 +2677,10 @@ ** valeur par défaut: `+25+` * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** description: pass:none[liste séparée par des virgules de capacités client ("client capabilities") à activer sur le serveur si elles sont disponibles (voir /help cap pour la liste des capacités supportées par WeeChat) (exemple : "away-notify,multi-prefix")] +** description: pass:none[liste séparée par des virgules de capacités client ("client capabilities") à activer sur le serveur si elles sont disponibles (voir /help cap pour la liste des capacités supportées par WeeChat) ; "*" active toutes les capacités par défaut (supportées par le serveur et WeeChat) ; le caractère joker "*" est autorisé ; une capacité commençant par "!" est exclue (exemple : "*,!account-*,!extended-join")] ** type: chaîne ** valeurs: toute chaîne -** valeur par défaut: `+""+` +** valeur par défaut: `+"*"+` * [[option_irc.server_default.charset_message]] *irc.server_default.charset_message* ** description: pass:none[partie du message IRC (reçu ou envoyé) qui est décodé/encode vers le jeu de caractères cible ; message = le message IRC entier (par défaut), channel = à partir du nom du canal seulement (si trouvé, sinon à partir du texte), text = à partir du texte seulement (vous devriez essayer cette valeur si vous avec des problèmes d'encodage avec le nom du canal)] diff --git a/doc/it/includes/autogen_user_options.it.adoc b/doc/it/includes/autogen_user_options.it.adoc index 83b2fd0a1..ac1452822 100644 --- a/doc/it/includes/autogen_user_options.it.adoc +++ b/doc/it/includes/autogen_user_options.it.adoc @@ -2677,10 +2677,10 @@ ** valore predefinito: `+25+` * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** descrizione: pass:none[comma-separated list of client capabilities to enable for server if they are available (see /help cap for a list of capabilities supported by WeeChat) (example: "away-notify,multi-prefix")] +** descrizione: pass:none[comma-separated list of client capabilities to enable for server if they are available (see /help cap for a list of capabilities supported by WeeChat); "*" enables all capabilities by default (supported by both server and WeeChat); wildcard "*" is allowed; a capability beginning with "!" is excluded (example: "*,!account-*,!extended-join")] ** tipo: stringa ** valori: qualsiasi stringa -** valore predefinito: `+""+` +** valore predefinito: `+"*"+` * [[option_irc.server_default.charset_message]] *irc.server_default.charset_message* ** descrizione: pass:none[part of the IRC message (received or sent) which is decoded/encoded to the target charset; message = the whole IRC message (default), channel = starting from the channel name only (if found, with fallback on text), text = starting from the text only (you should try this value if you have issues with the channel name encoding)] diff --git a/doc/ja/includes/autogen_user_options.ja.adoc b/doc/ja/includes/autogen_user_options.ja.adoc index 05552ae2e..aa97ffe5f 100644 --- a/doc/ja/includes/autogen_user_options.ja.adoc +++ b/doc/ja/includes/autogen_user_options.ja.adoc @@ -2677,10 +2677,10 @@ ** デフォルト値: `+25+` * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** 説明: pass:none[サーバで利用可能ならば有効化する "client capabilities" のコンマ区切りリスト (WeeChat がサポートする機能のリストは /help cap を参照してください) (例: "away-notify,multi-prefix")] +** 説明: pass:none[comma-separated list of client capabilities to enable for server if they are available (see /help cap for a list of capabilities supported by WeeChat); "*" enables all capabilities by default (supported by both server and WeeChat); wildcard "*" is allowed; a capability beginning with "!" is excluded (example: "*,!account-*,!extended-join")] ** タイプ: 文字列 ** 値: 未制約文字列 -** デフォルト値: `+""+` +** デフォルト値: `+"*"+` * [[option_irc.server_default.charset_message]] *irc.server_default.charset_message* ** 説明: pass:none[part of the IRC message (received or sent) which is decoded/encoded to the target charset; message = the whole IRC message (default), channel = starting from the channel name only (if found, with fallback on text), text = starting from the text only (you should try this value if you have issues with the channel name encoding)] diff --git a/doc/pl/includes/autogen_user_options.pl.adoc b/doc/pl/includes/autogen_user_options.pl.adoc index 29bfc5e51..4ea22c2a1 100644 --- a/doc/pl/includes/autogen_user_options.pl.adoc +++ b/doc/pl/includes/autogen_user_options.pl.adoc @@ -2677,10 +2677,10 @@ ** domyślna wartość: `+25+` * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** opis: pass:none[oddzielona przecinkami lista opcji klienta do włączenia dla serwera, jeśli są dostępne (zobacz /help cap żeby poznać listę opcji wspieranych przez WeeChat) (przykład: "away-notify,multi-prefix")] +** opis: pass:none[comma-separated list of client capabilities to enable for server if they are available (see /help cap for a list of capabilities supported by WeeChat); "*" enables all capabilities by default (supported by both server and WeeChat); wildcard "*" is allowed; a capability beginning with "!" is excluded (example: "*,!account-*,!extended-join")] ** typ: ciąg ** wartości: dowolny ciąg -** domyślna wartość: `+""+` +** domyślna wartość: `+"*"+` * [[option_irc.server_default.charset_message]] *irc.server_default.charset_message* ** opis: pass:none[część wiadomości IRC (otrzymanej lub wysłanej), która jest kodowana na ustawione kodowanie; message = cała wiadomość IRC (domyślne), channel = zaczynając od nazwy kanału (jeśli znaleziona, w przeciwnym wypadku text), text = zaczynając od samego tekstu (powinieneś spróbować tej wartości, jeśli masz problem z kodowaniem nazwy kanału)] diff --git a/doc/sr/includes/autogen_user_options.sr.adoc b/doc/sr/includes/autogen_user_options.sr.adoc index 30a210f1a..1200b59a2 100644 --- a/doc/sr/includes/autogen_user_options.sr.adoc +++ b/doc/sr/includes/autogen_user_options.sr.adoc @@ -2677,10 +2677,10 @@ ** подразумевана вредност: `+25+` * [[option_irc.server_default.capabilities]] *irc.server_default.capabilities* -** опис: pass:none[листа могућности клијента (client capabilities) раздвојених запетама које треба да се укључе за сервер у случају да су доступне (погледајте /help cap за листу могућности које подржава програм WeeChat) (пример: „away-notify,multi-prefix”)] +** опис: pass:none[comma-separated list of client capabilities to enable for server if they are available (see /help cap for a list of capabilities supported by WeeChat); "*" enables all capabilities by default (supported by both server and WeeChat); wildcard "*" is allowed; a capability beginning with "!" is excluded (example: "*,!account-*,!extended-join")] ** тип: стринг ** вредности: било који стринг -** подразумевана вредност: `+""+` +** подразумевана вредност: `+"*"+` * [[option_irc.server_default.charset_message]] *irc.server_default.charset_message* ** опис: pass:none[део IRC поруке (примљене или послате) који се декодира/кодира у циљни скуп карактера; порука = комплетна IRC порука (подразумевано), канал = почевши само од имена канала (ако се пронађе, ако не онда се узима текст), текст = почевши само од текста (требало би да пробате ову вредност ако имате проблеме са кодирањем имена канала)] @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8033,8 +8033,10 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" msgid "" @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-06-18 08:35+0200\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <kde-i18n-de@kde.org>\n" @@ -9882,10 +9882,17 @@ msgstr "" "evaluiert und ${server} wird durch den eigentlichen Servernamen ersetzt)" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) +#, fuzzy +#| msgid "" +#| "comma-separated list of client capabilities to enable for server if they " +#| "are available (see /help cap for a list of capabilities supported by " +#| "WeeChat) (example: \"away-notify,multi-prefix\")" msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" "durch Kommata getrennte Liste von erweiterten Client-Fähigkeiten (\"client " "capabilities\"), welche vom Server angeboten und genutzt werden sollen " @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8267,8 +8267,10 @@ msgstr "" #, fuzzy msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" "lista separada por comas de capabilidades del cliente (\"client capabilities" "\") para habilitar en el servidor si están disponibles (ejemplo: \"multi-" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" -"PO-Revision-Date: 2021-06-19 18:13+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" +"PO-Revision-Date: 2021-06-19 18:20+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -9705,13 +9705,17 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" "liste séparée par des virgules de capacités client (\"client capabilities\") " "à activer sur le serveur si elles sont disponibles (voir /help cap pour la " -"liste des capacités supportées par WeeChat) (exemple : \"away-notify,multi-" -"prefix\")" +"liste des capacités supportées par WeeChat) ; \"*\" active toutes les " +"capacités par défaut (supportées par le serveur et WeeChat) ; le caractère " +"joker \"*\" est autorisé ; une capacité commençant par \"!\" est exclue " +"(exemple : \"*,!account-*,!extended-join\")" msgid "" "mechanism for SASL authentication: \"plain\" for plain text password, " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7636,8 +7636,10 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" msgid "" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8412,8 +8412,10 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" #, fuzzy @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/" @@ -9270,10 +9270,17 @@ msgstr "" "こで ${irc_server.xxx} はサーバオプション、${server} はサーバ名を意味します)" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) +#, fuzzy +#| msgid "" +#| "comma-separated list of client capabilities to enable for server if they " +#| "are available (see /help cap for a list of capabilities supported by " +#| "WeeChat) (example: \"away-notify,multi-prefix\")" msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" "サーバで利用可能ならば有効化する \"client capabilities\" のコンマ区切りリス" "ト (WeeChat がサポートする機能のリストは /help cap を参照してください) (例: " @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-06-13 14:40+0200\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Language-Team: Polish <kde-i18n-doc@kde.org>\n" @@ -9517,10 +9517,17 @@ msgstr "" "jest zastępowany nazwą serwera)" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) +#, fuzzy +#| msgid "" +#| "comma-separated list of client capabilities to enable for server if they " +#| "are available (see /help cap for a list of capabilities supported by " +#| "WeeChat) (example: \"away-notify,multi-prefix\")" msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" "oddzielona przecinkami lista opcji klienta do włączenia dla serwera, jeśli " "są dostępne (zobacz /help cap żeby poznać listę opcji wspieranych przez " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Language-Team: Portuguese <>\n" @@ -9058,10 +9058,17 @@ msgstr "" "${nick}, ${channel} e ${server} são substituídas pelos respetivos valores)" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) +#, fuzzy +#| msgid "" +#| "comma-separated list of client capabilities to enable for server if they " +#| "are available (see /help cap for a list of capabilities supported by " +#| "WeeChat) (example: \"away-notify,multi-prefix\")" msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" "lista de capacidades do cliente (\"client capabilities\") a ativar no " "servidor se estiverem disponíveis (ver /help cap para obter uma lista de " diff --git a/po/pt_BR.po b/po/pt_BR.po index 1f9d948cb..d8115f2e3 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: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Érico Nogueira <ericonr@disroot.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8078,8 +8078,10 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" msgid "" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7667,8 +7667,10 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" msgid "" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-06-03 15:15+0400\n" "Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -9498,10 +9498,17 @@ msgstr "" "са именом сервера)" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) +#, fuzzy +#| msgid "" +#| "comma-separated list of client capabilities to enable for server if they " +#| "are available (see /help cap for a list of capabilities supported by " +#| "WeeChat) (example: \"away-notify,multi-prefix\")" msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" "листа могућности клијента (client capabilities) раздвојених запетама које " "треба да се укључе за сервер у случају да су доступне (погледајте /help cap " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Emir SARI <bitigchi@me.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7349,8 +7349,10 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" msgid "" diff --git a/po/weechat.pot b/po/weechat.pot index 6a0cdc8ee..f626f53f3 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: 2021-06-19 18:12+0200\n" +"POT-Creation-Date: 2021-06-19 18:14+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6819,8 +6819,10 @@ msgstr "" #. TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) msgid "" "comma-separated list of client capabilities to enable for server if they are " -"available (see /help cap for a list of capabilities supported by WeeChat) " -"(example: \"away-notify,multi-prefix\")" +"available (see /help cap for a list of capabilities supported by WeeChat); " +"\"*\" enables all capabilities by default (supported by both server and " +"WeeChat); wildcard \"*\" is allowed; a capability beginning with \"!\" is " +"excluded (example: \"*,!account-*,!extended-join\")" msgstr "" msgid "" diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 9c8d88087..05a18ee5f 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -6513,8 +6513,8 @@ irc_command_init () " /cap req multi-prefix away-notify"), "ls" " || list" - " || req " IRC_COMMAND_CAP_SUPPORTED_COMPLETION - " || ack " IRC_COMMAND_CAP_SUPPORTED_COMPLETION + " || req " IRC_COMMAND_CAP_SUPPORTED_COMPLETION "|%*" + " || ack " IRC_COMMAND_CAP_SUPPORTED_COMPLETION "|%*" " || end", &irc_command_cap, NULL, NULL); weechat_hook_command ( diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h index e9a82cdb7..cacfafcb1 100644 --- a/src/plugins/irc/irc-command.h +++ b/src/plugins/irc/irc-command.h @@ -56,7 +56,7 @@ struct t_irc_channel; /* list of supported capabilities (for completion in command /cap) */ #define IRC_COMMAND_CAP_SUPPORTED_COMPLETION \ "account-notify|away-notify|cap-notify|chghost|extended-join|" \ - "invite-notify|multi-prefix|server-time|setname|userhost-in-names|%*" + "invite-notify|multi-prefix|server-time|setname|userhost-in-names" /* list of supported CTCPs (for completion in command /ctcp) */ #define IRC_COMMAND_CTCP_SUPPORTED_COMPLETION \ diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 353621e46..8434041aa 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -1842,8 +1842,11 @@ irc_config_server_new_option (struct t_config_file *config_file, /* TRANSLATORS: please keep words "client capabilities" between brackets if translation is different (see fr.po) */ N_("comma-separated list of client capabilities to enable for " "server if they are available (see /help cap for a list of " - "capabilities supported by WeeChat) " - "(example: \"away-notify,multi-prefix\")"), + "capabilities supported by WeeChat); \"*\" enables all " + "capabilities by default (supported by both server and " + "WeeChat); wildcard \"*\" is allowed; a capability " + "beginning with \"!\" is excluded " + "(example: \"*,!account-*,!extended-join\")"), NULL, 0, 0, default_value, value, null_value_allowed, diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 40e49adcc..1d6dca990 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -590,16 +590,83 @@ irc_protocol_cap_print_cb (void *data, } /* + * Get capabilities to enable on the server (server option "capabilities" with + * "sasl" if requested, "*" is replaced by all supported capabilities). + * + * Note: result must be freed after use. + */ + +char * +irc_protocol_cap_to_enable (const char *capabilities, int sasl_requested) +{ + char **str_caps, **caps, *supported_caps; + int i, num_caps; + + str_caps = weechat_string_dyn_alloc (128); + if (!str_caps) + return NULL; + + if (capabilities && capabilities[0]) + { + caps = weechat_string_split ( + capabilities, + ",", + NULL, + WEECHAT_STRING_SPLIT_STRIP_LEFT + | WEECHAT_STRING_SPLIT_STRIP_RIGHT + | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, + 0, + &num_caps); + if (caps) + { + for (i = 0; i < num_caps; i++) + { + if (strcmp (caps[i], "*") == 0) + { + supported_caps = weechat_string_replace ( + IRC_COMMAND_CAP_SUPPORTED_COMPLETION, + "|", + ","); + if (supported_caps) + { + if (*str_caps[0]) + weechat_string_dyn_concat (str_caps, ",", -1); + weechat_string_dyn_concat (str_caps, supported_caps, -1); + free (supported_caps); + } + } + else + { + if (*str_caps[0]) + weechat_string_dyn_concat (str_caps, ",", -1); + weechat_string_dyn_concat (str_caps, caps[i], -1); + } + } + weechat_string_free_split (caps); + } + } + + if (sasl_requested) + { + if (*str_caps[0]) + weechat_string_dyn_concat (str_caps, ",", -1); + weechat_string_dyn_concat (str_caps, "sasl", -1); + } + + return weechat_string_dyn_free (str_caps, 0); +} + +/* * Synchronizes requested capabilities for IRC server. */ void irc_protocol_cap_sync (struct t_irc_server *server, int sasl) { - char *cap_option, *cap_req, **caps_requested; + char **caps_server, *caps_to_enable, **list_caps_to_enable, **cap_req; const char *ptr_cap_option; int sasl_requested, sasl_to_do, sasl_fail; - int i, length, num_caps_requested; + int i, num_caps_server; sasl_requested = (sasl) ? irc_server_sasl_enabled (server) : 0; sasl_to_do = 0; @@ -607,59 +674,59 @@ irc_protocol_cap_sync (struct t_irc_server *server, int sasl) ptr_cap_option = IRC_SERVER_OPTION_STRING( server, IRC_SERVER_OPTION_CAPABILITIES); - length = ((ptr_cap_option && ptr_cap_option[0]) ? - strlen (ptr_cap_option) : 0) + 16; - cap_option = malloc (length); - cap_req = malloc (length); - if (cap_option && cap_req) - { - cap_option[0] = '\0'; - if (ptr_cap_option && ptr_cap_option[0]) - strcat (cap_option, ptr_cap_option); - if (sasl && sasl_requested) - { - if (cap_option[0]) - strcat (cap_option, ","); - strcat (cap_option, "sasl"); - } - cap_req[0] = '\0'; - caps_requested = weechat_string_split ( - cap_option, + + cap_req = weechat_string_dyn_alloc (128); + + caps_to_enable = irc_protocol_cap_to_enable (ptr_cap_option, + sasl_requested); + list_caps_to_enable = weechat_string_split ( + caps_to_enable, + ",", + NULL, + WEECHAT_STRING_SPLIT_STRIP_LEFT + | WEECHAT_STRING_SPLIT_STRIP_RIGHT + | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, + 0, + NULL); + if (list_caps_to_enable) + { + caps_server = weechat_string_split ( + weechat_hashtable_get_string (server->cap_ls, "keys"), ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, 0, - &num_caps_requested); - if (caps_requested) + &num_caps_server); + if (caps_server) { - for (i = 0; i < num_caps_requested; i++) + for (i = 0; i < num_caps_server; i++) { - if (weechat_hashtable_has_key (server->cap_ls, - caps_requested[i]) && - !weechat_hashtable_has_key (server->cap_list, - caps_requested[i])) + if (!weechat_hashtable_has_key (server->cap_list, + caps_server[i]) + && weechat_string_match_list (caps_server[i], + (const char **)list_caps_to_enable, + 0)) { - if (sasl && strcmp (caps_requested[i], "sasl") == 0) + if (sasl && strcmp (caps_server[i], "sasl") == 0) sasl_to_do = 1; - if (cap_req[0]) - strcat (cap_req, " "); - strcat (cap_req, caps_requested[i]); + if (*cap_req[0]) + weechat_string_dyn_concat (cap_req, " ", -1); + weechat_string_dyn_concat (cap_req, caps_server[i], -1); } } - weechat_string_free_split (caps_requested); + weechat_string_free_split (caps_server); } - if (cap_req[0]) + if (*cap_req[0]) { weechat_printf ( server->buffer, _("%s%s: client capability, requesting: %s"), weechat_prefix ("network"), IRC_PLUGIN_NAME, - cap_req); - irc_server_sendf (server, 0, NULL, - "CAP REQ :%s", cap_req); + *cap_req); + irc_server_sendf (server, 0, NULL, "CAP REQ :%s", *cap_req); } if (sasl) @@ -687,11 +754,13 @@ irc_protocol_cap_sync (struct t_irc_server *server, int sasl) } } } + weechat_string_free_split (list_caps_to_enable); } - if (cap_option) - free (cap_option); + + if (caps_to_enable) + free (caps_to_enable); if (cap_req) - free (cap_req); + weechat_string_dyn_free (cap_req, 1); } /* diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 97d9691a7..d20c7479c 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -87,7 +87,7 @@ char *irc_server_options[IRC_SERVER_NUM_OPTIONS][2] = { "ssl_fingerprint", "" }, { "ssl_verify", "on" }, { "password", "" }, - { "capabilities", "" }, + { "capabilities", "*" }, { "sasl_mechanism", "plain" }, { "sasl_username", "" }, { "sasl_password", "" }, diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 6b9f2a7e2..eff9e3346 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -43,6 +43,8 @@ extern const char *irc_protocol_nick_address (struct t_irc_server *server, const char *nickname, const char *address); extern struct t_hashtable *irc_protocol_get_message_tags (const char *tags); +extern char *irc_protocol_cap_to_enable (const char *capabilities, + int sasl_requested); } #include "tests/tests.h" @@ -54,6 +56,15 @@ extern struct t_hashtable *irc_protocol_get_message_tags (const char *tags); "USERLEN=16 HOSTLEN=32 CHANNELLEN=50 TOPICLEN=390 DEAF=D " \ "CHANTYPES=# CHANMODES=eIbq,k,flj,CFLMPQScgimnprstuz " \ "MONITOR=100" +#define IRC_ALL_CAPS "account-notify,away-notify,cap-notify,chghost," \ + "extended-join,invite-notify,multi-prefix,server-time,setname," \ + "userhost-in-names" + +#define WEE_CHECK_CAP_TO_ENABLE(__result, __string, __sasl_requested) \ + str = irc_protocol_cap_to_enable (__string, __sasl_requested); \ + STRCMP_EQUAL(__result, str); \ + free (str); + struct t_irc_server *ptr_server; @@ -532,6 +543,25 @@ TEST(IrcProtocolWithServer, away) /* * Tests functions: + * irc_protocol_cap_to_enable + */ + +TEST(IrcProtocol, cap_to_enable) +{ + char *str; + + WEE_CHECK_CAP_TO_ENABLE("", NULL, 0); + WEE_CHECK_CAP_TO_ENABLE("", "", 0); + WEE_CHECK_CAP_TO_ENABLE("extended-join", "extended-join", 0); + WEE_CHECK_CAP_TO_ENABLE("extended-join,sasl", "extended-join", 1); + WEE_CHECK_CAP_TO_ENABLE(IRC_ALL_CAPS, "*", 0); + WEE_CHECK_CAP_TO_ENABLE(IRC_ALL_CAPS ",sasl", "*", 1); + WEE_CHECK_CAP_TO_ENABLE(IRC_ALL_CAPS ",!away-notify,!extended-join,sasl", + "*,!away-notify,!extended-join", 1); +} + +/* + * Tests functions: * irc_protocol_cb_cap */ |