diff options
author | Andrew Potter <agpotter@gmail.com> | 2023-01-29 16:43:20 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-01-29 16:50:57 +0100 |
commit | 4f0b6115a149b134b4a0cff3051b452ebe6dfdc1 (patch) | |
tree | 5186b3c52331bc045f20b8d38ed70bd021da66ff | |
parent | 3909d7761732f2bab8834be0a3c7783d4d2427de (diff) | |
download | weechat-4f0b6115a149b134b4a0cff3051b452ebe6dfdc1.zip |
irc: add server option "registered_mode" (closes #1625)
Two new fields are added in IRC server structure:
- "authentication_method", possible values:
0: not authenticated
1: authenticated with SASL
2: authenticated with other method
- "sasl_mechanism_used", possible values: see enum t_irc_sasl_mechanism
in src/plugins/irc/irc-sasl.h
36 files changed, 301 insertions, 15 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index ac6e62a2d..bb2348d12 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -23,6 +23,7 @@ New features:: * core: force ctrl keys to lower case when they are added (issue #1875) * core, plugins: make many identifiers case sensitive (issue #1872, issue #398, bug #32213) * alias: use lower case for default aliases (issue #1872) + * irc: add server option "registered_mode", add fields "authentication_method" and "sasl_mechanism_used" in server (issue #1625) * irc: add option `join` in command `/autojoin` Bug fixes:: diff --git a/doc/de/includes/autogen_api_hdata.de.adoc b/doc/de/includes/autogen_api_hdata.de.adoc index 45bf965ff..95998ecdf 100644 --- a/doc/de/includes/autogen_api_hdata.de.adoc +++ b/doc/de/includes/autogen_api_hdata.de.adoc @@ -241,6 +241,8 @@ _sasl_scram_salted_pwd_size_ (integer) + _sasl_scram_auth_message_ (string) + _sasl_temp_username_ (string) + _sasl_temp_password_ (string) + +_authentication_method_ (integer) + +_sasl_mechanism_used_ (integer) + _is_connected_ (integer) + _ssl_connected_ (integer) + _disconnected_ (integer) + diff --git a/doc/de/includes/autogen_user_options.de.adoc b/doc/de/includes/autogen_user_options.de.adoc index 725569fee..bc5067b31 100644 --- a/doc/de/includes/autogen_user_options.de.adoc +++ b/doc/de/includes/autogen_user_options.de.adoc @@ -1504,6 +1504,12 @@ ** Werte: beliebige Zeichenkette ** Standardwert: `+""+` +* [[option_irc.server_default.registered_mode]] *irc.server_default.registered_mode* +** Beschreibung: pass:none[mode that is set on registered users (default is "r")] +** Typ: Zeichenkette +** Werte: beliebige Zeichenkette +** Standardwert: `+"r"+` + * [[option_irc.server_default.sasl_fail]] *irc.server_default.sasl_fail* ** Beschreibung: pass:none[auszuführende Aktion falls die SASL Authentifizierung fehlschlägt: "continue" ignoriert das Problem welches bei der Authentifizierung aufgetreten ist, "reconnect" versucht erneut eine Verbindung herzustellen, "disconnect" trennt die Verbindung zum Server (siehe Option irc.network.sasl_fail_unavailable)] ** Typ: integer diff --git a/doc/en/includes/autogen_api_hdata.en.adoc b/doc/en/includes/autogen_api_hdata.en.adoc index ccfda5f8f..058edfad5 100644 --- a/doc/en/includes/autogen_api_hdata.en.adoc +++ b/doc/en/includes/autogen_api_hdata.en.adoc @@ -241,6 +241,8 @@ _sasl_scram_salted_pwd_size_ (integer) + _sasl_scram_auth_message_ (string) + _sasl_temp_username_ (string) + _sasl_temp_password_ (string) + +_authentication_method_ (integer) + +_sasl_mechanism_used_ (integer) + _is_connected_ (integer) + _ssl_connected_ (integer) + _disconnected_ (integer) + diff --git a/doc/en/includes/autogen_user_options.en.adoc b/doc/en/includes/autogen_user_options.en.adoc index f535df0f6..50dad693b 100644 --- a/doc/en/includes/autogen_user_options.en.adoc +++ b/doc/en/includes/autogen_user_options.en.adoc @@ -1504,6 +1504,12 @@ ** values: any string ** default value: `+""+` +* [[option_irc.server_default.registered_mode]] *irc.server_default.registered_mode* +** description: pass:none[mode that is set on registered users (default is "r")] +** type: string +** values: any string +** default value: `+"r"+` + * [[option_irc.server_default.sasl_fail]] *irc.server_default.sasl_fail* ** description: pass:none[action to perform if SASL authentication fails: "continue" to ignore the authentication problem, "reconnect" to schedule a reconnection to the server, "disconnect" to disconnect from server (see also option irc.network.sasl_fail_unavailable)] ** type: integer diff --git a/doc/fr/includes/autogen_api_hdata.fr.adoc b/doc/fr/includes/autogen_api_hdata.fr.adoc index 2984c6125..a79050434 100644 --- a/doc/fr/includes/autogen_api_hdata.fr.adoc +++ b/doc/fr/includes/autogen_api_hdata.fr.adoc @@ -241,6 +241,8 @@ _sasl_scram_salted_pwd_size_ (integer) + _sasl_scram_auth_message_ (string) + _sasl_temp_username_ (string) + _sasl_temp_password_ (string) + +_authentication_method_ (integer) + +_sasl_mechanism_used_ (integer) + _is_connected_ (integer) + _ssl_connected_ (integer) + _disconnected_ (integer) + diff --git a/doc/fr/includes/autogen_user_options.fr.adoc b/doc/fr/includes/autogen_user_options.fr.adoc index b9708ee9b..7511c6764 100644 --- a/doc/fr/includes/autogen_user_options.fr.adoc +++ b/doc/fr/includes/autogen_user_options.fr.adoc @@ -1504,6 +1504,12 @@ ** valeurs: toute chaîne ** valeur par défaut: `+""+` +* [[option_irc.server_default.registered_mode]] *irc.server_default.registered_mode* +** description: pass:none[mode qui est défini sur les utilisateurs qui se sont enregistrés (la valeur par défaut est "r")] +** type: chaîne +** valeurs: toute chaîne +** valeur par défaut: `+"r"+` + * [[option_irc.server_default.sasl_fail]] *irc.server_default.sasl_fail* ** description: pass:none[action à effectuer si l'authentification SASL échoue : "continue" pour ignorer le problème d'authentification, "reconnect" pour planifier une reconnexion au serveur, "disconnect" pour se déconnecter du serveur (voir aussi l'option irc.network.sasl_fail_unavailable)] ** type: entier diff --git a/doc/it/includes/autogen_api_hdata.it.adoc b/doc/it/includes/autogen_api_hdata.it.adoc index 9ce568074..d1133b798 100644 --- a/doc/it/includes/autogen_api_hdata.it.adoc +++ b/doc/it/includes/autogen_api_hdata.it.adoc @@ -241,6 +241,8 @@ _sasl_scram_salted_pwd_size_ (integer) + _sasl_scram_auth_message_ (string) + _sasl_temp_username_ (string) + _sasl_temp_password_ (string) + +_authentication_method_ (integer) + +_sasl_mechanism_used_ (integer) + _is_connected_ (integer) + _ssl_connected_ (integer) + _disconnected_ (integer) + diff --git a/doc/it/includes/autogen_user_options.it.adoc b/doc/it/includes/autogen_user_options.it.adoc index ae845388e..2ede7dd20 100644 --- a/doc/it/includes/autogen_user_options.it.adoc +++ b/doc/it/includes/autogen_user_options.it.adoc @@ -1504,6 +1504,12 @@ ** valori: qualsiasi stringa ** valore predefinito: `+""+` +* [[option_irc.server_default.registered_mode]] *irc.server_default.registered_mode* +** descrizione: pass:none[mode that is set on registered users (default is "r")] +** tipo: stringa +** valori: qualsiasi stringa +** valore predefinito: `+"r"+` + * [[option_irc.server_default.sasl_fail]] *irc.server_default.sasl_fail* ** descrizione: pass:none[action to perform if SASL authentication fails: "continue" to ignore the authentication problem, "reconnect" to schedule a reconnection to the server, "disconnect" to disconnect from server (see also option irc.network.sasl_fail_unavailable)] ** tipo: intero diff --git a/doc/ja/includes/autogen_api_hdata.ja.adoc b/doc/ja/includes/autogen_api_hdata.ja.adoc index 36888d1f5..8ae00e190 100644 --- a/doc/ja/includes/autogen_api_hdata.ja.adoc +++ b/doc/ja/includes/autogen_api_hdata.ja.adoc @@ -241,6 +241,8 @@ _sasl_scram_salted_pwd_size_ (integer) + _sasl_scram_auth_message_ (string) + _sasl_temp_username_ (string) + _sasl_temp_password_ (string) + +_authentication_method_ (integer) + +_sasl_mechanism_used_ (integer) + _is_connected_ (integer) + _ssl_connected_ (integer) + _disconnected_ (integer) + diff --git a/doc/ja/includes/autogen_user_options.ja.adoc b/doc/ja/includes/autogen_user_options.ja.adoc index 72d603857..33faba755 100644 --- a/doc/ja/includes/autogen_user_options.ja.adoc +++ b/doc/ja/includes/autogen_user_options.ja.adoc @@ -1504,6 +1504,12 @@ ** 値: 未制約文字列 ** デフォルト値: `+""+` +* [[option_irc.server_default.registered_mode]] *irc.server_default.registered_mode* +** 説明: pass:none[mode that is set on registered users (default is "r")] +** タイプ: 文字列 +** 値: 未制約文字列 +** デフォルト値: `+"r"+` + * [[option_irc.server_default.sasl_fail]] *irc.server_default.sasl_fail* ** 説明: pass:none[SASL 認証が失敗した場合の挙動: 認証の問題を無視する場合は "continue"、サーバへの再接続を予定する場合は "reconnect"、サーバから切断する場合は "disconnect" (irc.network.sasl_fail_unavailable も参照してください)] ** タイプ: 整数 diff --git a/doc/pl/includes/autogen_api_hdata.pl.adoc b/doc/pl/includes/autogen_api_hdata.pl.adoc index 89eb28fb1..443b94294 100644 --- a/doc/pl/includes/autogen_api_hdata.pl.adoc +++ b/doc/pl/includes/autogen_api_hdata.pl.adoc @@ -241,6 +241,8 @@ _sasl_scram_salted_pwd_size_ (integer) + _sasl_scram_auth_message_ (string) + _sasl_temp_username_ (string) + _sasl_temp_password_ (string) + +_authentication_method_ (integer) + +_sasl_mechanism_used_ (integer) + _is_connected_ (integer) + _ssl_connected_ (integer) + _disconnected_ (integer) + diff --git a/doc/pl/includes/autogen_user_options.pl.adoc b/doc/pl/includes/autogen_user_options.pl.adoc index bdb02a6a1..9d48edf0d 100644 --- a/doc/pl/includes/autogen_user_options.pl.adoc +++ b/doc/pl/includes/autogen_user_options.pl.adoc @@ -1504,6 +1504,12 @@ ** wartości: dowolny ciąg ** domyślna wartość: `+""+` +* [[option_irc.server_default.registered_mode]] *irc.server_default.registered_mode* +** opis: pass:none[mode that is set on registered users (default is "r")] +** typ: ciąg +** wartości: dowolny ciąg +** domyślna wartość: `+"r"+` + * [[option_irc.server_default.sasl_fail]] *irc.server_default.sasl_fail* ** opis: pass:none[akcja do wykonania jeśli uwierzytelnianie SASL się nie powiedzie: "continue" dla zignorowania problemu, "reconnect" ponownie połącz się z serwerem, "disconnect" odłącz od serwera (zobacz też opcję irc.network.sasl_fail_unavailable)] ** typ: liczba diff --git a/doc/sr/includes/autogen_api_hdata.sr.adoc b/doc/sr/includes/autogen_api_hdata.sr.adoc index 0947aee51..ea25bdeba 100644 --- a/doc/sr/includes/autogen_api_hdata.sr.adoc +++ b/doc/sr/includes/autogen_api_hdata.sr.adoc @@ -241,6 +241,8 @@ _sasl_scram_salted_pwd_size_ (integer) + _sasl_scram_auth_message_ (string) + _sasl_temp_username_ (string) + _sasl_temp_password_ (string) + +_authentication_method_ (integer) + +_sasl_mechanism_used_ (integer) + _is_connected_ (integer) + _ssl_connected_ (integer) + _disconnected_ (integer) + diff --git a/doc/sr/includes/autogen_user_options.sr.adoc b/doc/sr/includes/autogen_user_options.sr.adoc index fe262878b..c81258065 100644 --- a/doc/sr/includes/autogen_user_options.sr.adoc +++ b/doc/sr/includes/autogen_user_options.sr.adoc @@ -1504,6 +1504,12 @@ ** вредности: било који стринг ** подразумевана вредност: `+""+` +* [[option_irc.server_default.registered_mode]] *irc.server_default.registered_mode* +** опис: pass:none[mode that is set on registered users (default is "r")] +** тип: стринг +** вредности: било који стринг +** подразумевана вредност: `+"r"+` + * [[option_irc.server_default.sasl_fail]] *irc.server_default.sasl_fail* ** опис: pass:none[радња која се преузима у случају да SASL аутентификација не успе: „continue” да се игнорише проблем аутентификације, „reconnect” да се закаже поновно повезивање са сервером, „disconnect” да се прекине веза са сервером (погледајте и опцију irc.network.sasl_fail_unavailable)] ** тип: целобројна @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8309,6 +8309,10 @@ msgid "" msgstr "" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -8680,6 +8684,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, fuzzy, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: chyba při přidávání notifikace" @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2023-01-29 13:05+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German - Germany <weechatter@arcor.de>\n" @@ -10340,6 +10340,10 @@ msgstr "" "entweder 0 oder ein Integer zwischen 128 und 4096 sein" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -10803,6 +10807,9 @@ msgstr "" "Kanal-Typ-Präfix, die verwendet werden sollen, wenn der Server diese nicht " "in Nachricht 005 sendet (Standard ist \"#&\")" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: Fehler bei der Erstellung des Servers \"%s\"" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Santiago Forero <santiago@forero.xyz>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8905,6 +8905,10 @@ msgid "" msgstr "" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -9287,6 +9291,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, fuzzy, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: error al crear el servidor \"%s\"" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" -"PO-Revision-Date: 2023-01-29 12:17+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" +"PO-Revision-Date: 2023-01-29 16:50+0100\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -10156,6 +10156,10 @@ msgstr "" "tout entier compris entre 128 et 4096" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "%s%s : mode enregistré invalide, doit être un seul caractère" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -10597,6 +10601,11 @@ msgstr "" "préfixes de types de canaux à utiliser si le serveur ne les envoie pas dans " "le message 005 (par défaut \"#&\")" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" +"mode qui est défini sur les utilisateurs qui se sont enregistrés (la valeur " +"par défaut est \"r\")" + #, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s : erreur d'ajout du serveur \"%s\"" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7860,6 +7860,10 @@ msgid "" msgstr "" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -8212,6 +8216,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, fuzzy, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s nincs elég memória az információs pult üzenethez\n" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8671,6 +8671,10 @@ msgid "" msgstr "" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -9054,6 +9058,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, fuzzy, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: errore durante la creazione del server \"%s\"" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/" @@ -9711,6 +9711,10 @@ msgstr "" "整数にしてください" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -10125,6 +10129,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: サーバ \"%s\" 追加中のエラー" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-12-30 14:10+0100\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Language-Team: Polish <kde-i18n-doc@kde.org>\n" @@ -10254,6 +10254,10 @@ msgstr "" "pomiędzy 128 a 4096" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -10687,6 +10691,9 @@ msgstr "" "prefiks typu kanału jeśli serwer nie wyśle jego w wiadomości 005 (domyślnie " "„#&”)" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: błąd podczas dodawania serwera \"%s\"" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Language-Team: Portuguese <>\n" @@ -9483,6 +9483,10 @@ msgid "" msgstr "" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -9905,6 +9909,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: erro ao adicionar ao servidor \"%s\"" diff --git a/po/pt_BR.po b/po/pt_BR.po index 791359cff..2d4fcf42e 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-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Érico Nogueira <ericonr@disroot.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8335,6 +8335,10 @@ msgid "" msgstr "" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -8686,6 +8690,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, fuzzy, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: erro ao criar servidor \"%s\"" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7890,6 +7890,10 @@ msgid "" msgstr "" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -8244,6 +8248,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, fuzzy, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s недостаточно памяти для сообщения в строке информации\n" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-12-05 09:44+0400\n" "Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -10430,6 +10430,10 @@ msgstr "" "између 128 и 4096" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -10862,6 +10866,9 @@ msgstr "" "префикси типа канала који треба да се користе у случају да их сервер не шаље " "у поруци 005 (подразумевана вредност је „#&”)" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: грешка приликом додавање сервера „%s”" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Emir SARI <emir_sari@icloud.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -10462,6 +10462,10 @@ msgstr "" "tamsayı olmalıdır" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -10889,6 +10893,9 @@ msgstr "" "eğer sunucu kanal türü öneklerini 005 iletisinde göndermiyorsa kullanılacak " "önekler (öntanımlı: \"#&\")" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, c-format msgid "%s%s: error adding server \"%s\"" msgstr "%s%s: \"%s\" sunucusu eklenirken hata" diff --git a/po/weechat.pot b/po/weechat.pot index 0f890faea..4bbb97bfd 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-01-29 12:15+0100\n" +"POT-Creation-Date: 2023-01-29 16:50+0100\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" @@ -7059,6 +7059,10 @@ msgid "" msgstr "" #, c-format +msgid "%s%s: invalid registered mode, must be a single character" +msgstr "" + +#, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " "memory because it's currently used" @@ -7346,6 +7350,9 @@ msgid "" "(default is \"#&\")" msgstr "" +msgid "mode that is set on registered users (default is \"r\")" +msgstr "" + #, c-format msgid "%s%s: error adding server \"%s\"" msgstr "" diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 5362ca468..57304bf38 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -34,6 +34,7 @@ #include "irc-channel.h" #include "irc-ctcp.h" #include "irc-ignore.h" +#include "irc-mode.h" #include "irc-msgbuffer.h" #include "irc-nick.h" #include "irc-notify.h" @@ -1000,6 +1001,9 @@ irc_config_server_default_change_cb (const void *pointer, void *data, else irc_server_remove_away (ptr_server); break; + case IRC_SERVER_OPTION_REGISTERED_MODE: + irc_mode_registered_mode_change (ptr_server); + break; } } } @@ -1218,6 +1222,20 @@ irc_config_server_check_value_cb (const void *pointer, void *data, return 0; } break; + case IRC_SERVER_OPTION_REGISTERED_MODE: + if (!value || !value[0]) + break; + /* Only one character should be accepted */ + if (value[1]) + { + weechat_printf ( + NULL, + _("%s%s: invalid registered mode, must be a single " + "character"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); + return 0; + } + break; } } @@ -1270,6 +1288,9 @@ irc_config_server_change_cb (const void *pointer, void *data, case IRC_SERVER_OPTION_NOTIFY: irc_notify_new_for_server (ptr_server); break; + case IRC_SERVER_OPTION_REGISTERED_MODE: + irc_mode_registered_mode_change (ptr_server); + break; } } } @@ -2502,6 +2523,22 @@ irc_config_server_new_option (struct t_config_file *config_file, callback_change_data, NULL, NULL, NULL); break; + case IRC_SERVER_OPTION_REGISTERED_MODE: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("mode that is set on registered users (default is \"r\")"), + NULL, 0, 0, + default_value, value, + null_value_allowed, + callback_check_value, + callback_check_value_pointer, + callback_check_value_data, + callback_change, + callback_change_pointer, + callback_change_data, + NULL, NULL, NULL); + break; case IRC_SERVER_NUM_OPTIONS: break; } diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c index de85dfe55..4fc8cde9b 100644 --- a/src/plugins/irc/irc-mode.c +++ b/src/plugins/irc/irc-mode.c @@ -585,6 +585,7 @@ void irc_mode_user_add (struct t_irc_server *server, char mode) { char str_mode[2], *nick_modes2; + const char *registered_mode; str_mode[0] = mode; str_mode[1] = '\0'; @@ -617,6 +618,15 @@ irc_mode_user_add (struct t_irc_server *server, char mode) weechat_bar_item_update ("input_prompt"); weechat_bar_item_update ("irc_nick_modes"); } + + registered_mode = IRC_SERVER_OPTION_STRING( + server, IRC_SERVER_OPTION_REGISTERED_MODE); + if (registered_mode + && (registered_mode[0] == mode) + && (server->authentication_method == IRC_SERVER_AUTH_METHOD_NONE)) + { + server->authentication_method = IRC_SERVER_AUTH_METHOD_OTHER; + } } /* @@ -627,6 +637,7 @@ void irc_mode_user_remove (struct t_irc_server *server, char mode) { char *pos, *nick_modes2; + const char *registered_mode; int new_size; if (server->nick_modes) @@ -643,6 +654,11 @@ irc_mode_user_remove (struct t_irc_server *server, char mode) weechat_bar_item_update ("irc_nick_modes"); } } + + registered_mode = IRC_SERVER_OPTION_STRING( + server, IRC_SERVER_OPTION_REGISTERED_MODE); + if (registered_mode && (registered_mode[0] == mode)) + server->authentication_method = IRC_SERVER_AUTH_METHOD_NONE; } /* @@ -695,3 +711,31 @@ irc_mode_user_set (struct t_irc_server *server, const char *modes, weechat_bar_item_update ("input_prompt"); weechat_bar_item_update ("irc_nick_modes"); } + +/* + * Updates authentication_method when IRC_SERVER_OPTION_REGISTERED_MODE + * changes. + */ + +void +irc_mode_registered_mode_change (struct t_irc_server *server) +{ + const char *ptr_mode, *registered_mode; + + registered_mode = IRC_SERVER_OPTION_STRING( + server, IRC_SERVER_OPTION_REGISTERED_MODE); + + ptr_mode = (server->nick_modes && registered_mode[0]) ? + strchr (server->nick_modes, registered_mode[0]) : NULL; + + if (ptr_mode) + { + if (server->authentication_method == IRC_SERVER_AUTH_METHOD_NONE) + server->authentication_method = IRC_SERVER_AUTH_METHOD_OTHER; + } + else + { + if (server->authentication_method == IRC_SERVER_AUTH_METHOD_OTHER) + server->authentication_method = IRC_SERVER_AUTH_METHOD_NONE; + } +} diff --git a/src/plugins/irc/irc-mode.h b/src/plugins/irc/irc-mode.h index 76b21cee4..6682602e7 100644 --- a/src/plugins/irc/irc-mode.h +++ b/src/plugins/irc/irc-mode.h @@ -33,5 +33,6 @@ extern int irc_mode_channel_set (struct t_irc_server *server, const char *modes_arguments); extern void irc_mode_user_set (struct t_irc_server *server, const char *modes, int reset_modes); +extern void irc_mode_registered_mode_change (struct t_irc_server *server); #endif /* WEECHAT_PLUGIN_IRC_MODE_H */ diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 54b1ac7b3..a4eba464d 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -571,6 +571,10 @@ IRC_PROTOCOL_CALLBACK(authenticate) IRC_PLUGIN_NAME, sasl_error); } + else + { + server->sasl_mechanism_used = sasl_mechanism; + } irc_server_sendf (server, 0, NULL, "AUTHENTICATE %s", answer); free (answer); } @@ -7281,6 +7285,8 @@ IRC_PROTOCOL_CALLBACK(sasl_end_ok) IRC_PROTOCOL_RUN_CALLBACK(numeric); + server->authentication_method = IRC_SERVER_AUTH_METHOD_SASL; + if (!server->is_connected) irc_server_sendf (server, 0, NULL, "CAP END"); @@ -7306,6 +7312,9 @@ IRC_PROTOCOL_CALLBACK(sasl_end_fail) server->hook_timer_sasl = NULL; } + server->authentication_method = IRC_SERVER_AUTH_METHOD_NONE; + server->sasl_mechanism_used = -1; + IRC_PROTOCOL_RUN_CALLBACK(numeric); sasl_fail = IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SASL_FAIL); diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 1c5726bc6..7392e1298 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -122,6 +122,7 @@ char *irc_server_options[IRC_SERVER_NUM_OPTIONS][2] = { "split_msg_max_length", "512" }, { "charset_message", "message" }, { "default_chantypes", "#&" }, + { "registered_mode", "r" }, }; char *irc_server_casemapping_string[IRC_SERVER_NUM_CASEMAPPING] = @@ -1555,6 +1556,8 @@ irc_server_alloc (const char *name) new_server->sasl_scram_auth_message = NULL; new_server->sasl_temp_username = NULL; new_server->sasl_temp_password = NULL; + new_server->authentication_method = IRC_SERVER_AUTH_METHOD_NONE; + new_server->sasl_mechanism_used = -1; new_server->is_connected = 0; new_server->ssl_connected = 0; new_server->disconnected = 0; @@ -3975,6 +3978,8 @@ irc_server_close_connection (struct t_irc_server *server) weechat_hashtable_remove_all (server->join_noswitch); /* server is now disconnected */ + server->authentication_method = IRC_SERVER_AUTH_METHOD_NONE; + server->sasl_mechanism_used = -1; server->is_connected = 0; server->ssl_connected = 0; @@ -6113,6 +6118,8 @@ irc_server_hdata_server_cb (const void *pointer, void *data, WEECHAT_HDATA_VAR(struct t_irc_server, sasl_scram_auth_message, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, sasl_temp_username, STRING, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, sasl_temp_password, STRING, 0, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_irc_server, authentication_method, INTEGER, 0, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_irc_server, sasl_mechanism_used, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, is_connected, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, ssl_connected, INTEGER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, disconnected, INTEGER, 0, NULL, NULL); @@ -6483,6 +6490,10 @@ irc_server_add_to_infolist (struct t_infolist *infolist, if (!weechat_infolist_new_var_time (ptr_item, "lag_last_refresh", server->lag_last_refresh)) return 0; } + if (!weechat_infolist_new_var_integer (ptr_item, "authentication_method", server->authentication_method)) + return 0; + if (!weechat_infolist_new_var_integer (ptr_item, "sasl_mechanism_used", server->sasl_mechanism_used)) + return 0; if (!weechat_infolist_new_var_string (ptr_item, "isupport", server->isupport)) return 0; if (!weechat_infolist_new_var_string (ptr_item, "prefix_modes", server->prefix_modes)) @@ -6857,6 +6868,8 @@ irc_server_print_log () weechat_log_printf (" sasl_scram_auth_message . : (hidden)"); weechat_log_printf (" sasl_temp_username. . . . : '%s'", ptr_server->sasl_temp_username); weechat_log_printf (" sasl_temp_password. . . . : (hidden)"); + weechat_log_printf (" authentication_method . . : %d", ptr_server->authentication_method); + weechat_log_printf (" sasl_mechanism_used . . . : %d", ptr_server->sasl_mechanism_used); weechat_log_printf (" is_connected. . . . . . . : %d", ptr_server->is_connected); weechat_log_printf (" ssl_connected . . . . . . : %d", ptr_server->ssl_connected); weechat_log_printf (" disconnected. . . . . . . : %d", ptr_server->disconnected); diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h index 0a9fa25a3..7ac282a8f 100644 --- a/src/plugins/irc/irc-server.h +++ b/src/plugins/irc/irc-server.h @@ -94,6 +94,7 @@ enum t_irc_server_option IRC_SERVER_OPTION_SPLIT_MSG_MAX_LENGTH, /* max length of messages */ IRC_SERVER_OPTION_CHARSET_MESSAGE, /* what to decode/encode in msg */ IRC_SERVER_OPTION_DEFAULT_CHANTYPES, /* chantypes if not received */ + IRC_SERVER_OPTION_REGISTERED_MODE, /* mode set on registered user */ /* number of server options */ IRC_SERVER_NUM_OPTIONS, }; @@ -153,6 +154,14 @@ enum t_irc_server_utf8mapping IRC_SERVER_NUM_UTF8MAPPING, }; +/* authentication method */ +enum t_irc_server_auth_method +{ + IRC_SERVER_AUTH_METHOD_NONE = 0, + IRC_SERVER_AUTH_METHOD_SASL, + IRC_SERVER_AUTH_METHOD_OTHER, +}; + /* output queue of messages to server (for sending slowly to server) */ struct t_irc_outqueue @@ -200,6 +209,8 @@ struct t_irc_server char *sasl_scram_auth_message; /* auth message for SASL SCRAM */ char *sasl_temp_username; /* temp SASL username (set by /auth cmd) */ char *sasl_temp_password; /* temp SASL password (set by /auth cmd) */ + int authentication_method; /* authentication method used to login */ + int sasl_mechanism_used; /* SASL method used at login time */ int is_connected; /* 1 if WeeChat is connected to server */ int ssl_connected; /* = 1 if connected with SSL */ int disconnected; /* 1 if server has been disconnected */ diff --git a/src/plugins/irc/irc-upgrade.c b/src/plugins/irc/irc-upgrade.c index 374fbf195..851f93482 100644 --- a/src/plugins/irc/irc-upgrade.c +++ b/src/plugins/irc/irc-upgrade.c @@ -416,6 +416,20 @@ irc_upgrade_read_cb (const void *pointer, void *data, irc_upgrade_current_server, NULL); } + /* + * "authentication_method" and "sasl_mechanism_used" are + * new in WeeChat 3.9 + */ + if (weechat_infolist_search_var (infolist, "authentication_method")) + { + irc_upgrade_current_server->authentication_method = weechat_infolist_integer (infolist, "authentication_method"); + irc_upgrade_current_server->sasl_mechanism_used = weechat_infolist_integer (infolist, "sasl_mechanism_used"); + } + else + { + irc_upgrade_current_server->authentication_method = IRC_SERVER_AUTH_METHOD_NONE; + irc_upgrade_current_server->sasl_mechanism_used = -1; + } irc_upgrade_current_server->is_connected = weechat_infolist_integer (infolist, "is_connected"); irc_upgrade_current_server->ssl_connected = weechat_infolist_integer (infolist, "ssl_connected"); irc_upgrade_current_server->disconnected = weechat_infolist_integer (infolist, "disconnected"); |