diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 539413a34..3fd86c565 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -43,6 +43,7 @@ New features:: * irc: add command `/knock` (issue #7) * 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` + * irc: add option `buffer` in command `/autojoin sort` (issue #1876) * irc: add `${username}` in server options "nicks" and "username", change their default values to use it * logger: add info "logger_log_file" * relay: rename "ssl" options and protocol to "tls" diff --git a/po/cs.po b/po/cs.po index 7990e1237..e0697aa84 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -7244,7 +7244,7 @@ msgstr "konfigurační nastavení" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -7260,6 +7260,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -7271,7 +7272,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" msgid "ban nicks or hosts" diff --git a/po/de.po b/po/de.po index 4e6a1e665..e9344b41a 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-04-28 08:19+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German - Germany \n" @@ -9091,15 +9091,46 @@ msgstr "" msgid "configure the \"autojoin\" server option" msgstr "Konfigurieren der Serveroption \"autojoin\"" +#, fuzzy +#| msgid "" +#| "add [ [...]] || addraw [,...] " +#| "[[,...]] || del [ [...]] || apply || join " +#| "|| sort" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " "sort" +#, fuzzy +#| msgid "" +#| " add: add current channel or a list of channels (with optional keys) " +#| "to the autojoin option; if you are on the channel and the key is not " +#| "provided, the key is read in the channel\n" +#| " addraw: use the IRC raw format (same as /join command): all channels " +#| "separated by commas, optional keys separated by commas\n" +#| " del: delete current channel or a list of channels from the autojoin " +#| "option\n" +#| "channel: channel name\n" +#| " key: key for the channel\n" +#| " apply: set currently joined channels in the autojoin option\n" +#| " join: join the channels in the autojoin option\n" +#| " sort: sort alphabetically channels in the autojoin option\n" +#| "\n" +#| "Examples:\n" +#| " /autojoin add\n" +#| " /autojoin add #test\n" +#| " /autojoin add #chan1 #chan2\n" +#| " /allchan /autojoin add\n" +#| " /autojoin addraw #chan1,#chan2,#chan3 key1,key2\n" +#| " /autojoin del\n" +#| " /autojoin del #chan1\n" +#| " /autojoin apply\n" +#| " /autojoin join\n" +#| " /autojoin sort" msgid "" " add: add current channel or a list of channels (with optional keys) to " "the autojoin option; if you are on the channel and the key is not provided, " @@ -9113,6 +9144,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -9124,7 +9156,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" " add: Hinzufügen des aktuellen Kanals oder einer Liste von Kanälen (mit " "optionalen Schlüsseln) zur autojoin-Option; Wenn Sie sich in dem Kanal " diff --git a/po/es.po b/po/es.po index 4405d7a06..636dbbdf3 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -7882,7 +7882,7 @@ msgstr "opciones de configuración" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -7898,6 +7898,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -7909,7 +7910,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" msgid "ban nicks or hosts" diff --git a/po/fr.po b/po/fr.po index 7e53bb6e6..1526f2fc5 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" -"PO-Revision-Date: 2023-04-27 22:54+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" +"PO-Revision-Date: 2023-05-01 17:02+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -8925,10 +8925,10 @@ msgstr "configurer l'option serveur \"autojoin\"" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" "add [ [...]] || addraw [,...] [[," -"...]] || del [ [...]] || apply || join || sort" +"...]] || del [ [...]] || apply || join || sort [buffer]" msgid "" " add: add current channel or a list of channels (with optional keys) to " @@ -8943,6 +8943,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -8954,7 +8955,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" " add : ajouter le canal courant ou une liste de canaux (avec clés " "facultatives) dans l'option autojoin ; si vous êtes sur le canal et que la " @@ -8969,6 +8971,7 @@ msgstr "" " apply : définir les canaux actuellement joints dans l'option autojoin\n" " join : joindre les canaux de l'option autojoin\n" " sort : trier les canaux de l'option autojoin par ordre alphabétique\n" +" buffer : trier les canaux de l'option autojoin par ordre des tampons\n" "\n" "Exemples :\n" " /autojoin add\n" @@ -8980,7 +8983,8 @@ msgstr "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgid "ban nicks or hosts" msgstr "bannir des pseudos ou hôtes" diff --git a/po/hu.po b/po/hu.po index 71a2306e2..0880a8c2d 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -6697,7 +6697,7 @@ msgstr "Nem található az opció\n" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -6713,6 +6713,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -6724,7 +6725,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" #, fuzzy diff --git a/po/it.po b/po/it.po index 14c8ce5b1..b7029443a 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -7582,7 +7582,7 @@ msgstr "opzioni di configurazione" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -7598,6 +7598,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -7609,7 +7610,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" msgid "ban nicks or hosts" diff --git a/po/ja.po b/po/ja.po index 0ccfac1fa..e62f9b355 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -8616,6 +8616,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -8627,7 +8628,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" msgid "ban nicks or hosts" diff --git a/po/pl.po b/po/pl.po index b674a85dc..4fb35fcdd 100644 --- a/po/pl.po +++ b/po/pl.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-04-13 20:09+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: Polish \n" @@ -9374,7 +9374,7 @@ msgstr "konfiguruje opcje serwera \"autojoin\"" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" "add [ [...]] || addraw [,...] [[," "...]] || del [ [...]] || apply || sort" @@ -9416,6 +9416,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -9427,7 +9428,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" " add: dodaje obecny kanał albo listę kanałów (z opcjonalnymi hasłami) do " "opcji autojoin; jeśli jesteś na kanale i hasło nie zostało podane, jest ono " diff --git a/po/pt.po b/po/pt.po index 5c79ea6b9..cb23d045f 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -8348,7 +8348,7 @@ msgstr "opções de configuração" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -8364,6 +8364,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -8375,7 +8376,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" msgid "ban nicks or hosts" diff --git a/po/pt_BR.po b/po/pt_BR.po index 0897d80f9..0817cc570 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -7426,7 +7426,7 @@ msgstr "opções de configuração" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -7442,6 +7442,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -7453,7 +7454,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" msgid "ban nicks or hosts" diff --git a/po/ru.po b/po/ru.po index e4f241a02..330a799cb 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -6739,7 +6739,7 @@ msgstr "Не найден параметр\n" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -6755,6 +6755,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -6766,7 +6767,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" #, fuzzy diff --git a/po/sr.po b/po/sr.po index c929a5716..545f03168 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-04-13 20:10+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -9104,14 +9104,45 @@ msgstr "" msgid "configure the \"autojoin\" server option" msgstr "конфигурисање „autojoin” (аутоприступ) серверске опције" +#, fuzzy +#| msgid "" +#| "add [ [...]] || addraw [,...] " +#| "[[,...]] || del [ [...]] || apply || join " +#| "|| sort" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" "add [<канал1> [<канал2>...]] || addraw <канал1>[,<канал2>...] [<кључ1>[," "<кључ2>...]] || del [<канал1> [<канал2>...]] || apply || join || sort" +#, fuzzy +#| msgid "" +#| " add: add current channel or a list of channels (with optional keys) " +#| "to the autojoin option; if you are on the channel and the key is not " +#| "provided, the key is read in the channel\n" +#| " addraw: use the IRC raw format (same as /join command): all channels " +#| "separated by commas, optional keys separated by commas\n" +#| " del: delete current channel or a list of channels from the autojoin " +#| "option\n" +#| "channel: channel name\n" +#| " key: key for the channel\n" +#| " apply: set currently joined channels in the autojoin option\n" +#| " join: join the channels in the autojoin option\n" +#| " sort: sort alphabetically channels in the autojoin option\n" +#| "\n" +#| "Examples:\n" +#| " /autojoin add\n" +#| " /autojoin add #test\n" +#| " /autojoin add #chan1 #chan2\n" +#| " /allchan /autojoin add\n" +#| " /autojoin addraw #chan1,#chan2,#chan3 key1,key2\n" +#| " /autojoin del\n" +#| " /autojoin del #chan1\n" +#| " /autojoin apply\n" +#| " /autojoin join\n" +#| " /autojoin sort" msgid "" " add: add current channel or a list of channels (with optional keys) to " "the autojoin option; if you are on the channel and the key is not provided, " @@ -9125,6 +9156,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -9136,7 +9168,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" " add: додаје текући канал или листу канала (са необавезним кључевима) у " "autojoin опцију; ако се налазите на каналу и не наведете кључ, он се чита са " diff --git a/po/tr.po b/po/tr.po index a1c9b98a1..e4ccd9cf4 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2023-04-23 16:51+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -8966,7 +8966,7 @@ msgstr "\"autojoin\" sunucu seçeneğini yapılandır" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" "add [ [...]] || addraw [,...] [[," "...]] || del [ [...]] || apply || sort" @@ -9008,6 +9008,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -9019,7 +9020,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" " add: geçerli kanalı veya bir kanal listesini (isteğe bağlı anahtarlarla) " "autojoin seçeneğine ekle; kanaldaysanız ve anahtar sağlanmamışsa anahtar " diff --git a/po/weechat.pot b/po/weechat.pot index 48837c4f7..cd32bf577 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-27 22:53+0200\n" +"POT-Creation-Date: 2023-05-01 16:57+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -6184,7 +6184,7 @@ msgstr "" msgid "" "add [ [...]] || addraw [,...] " "[[,...]] || del [ [...]] || apply || join || " -"sort" +"sort [buffer]" msgstr "" msgid "" @@ -6200,6 +6200,7 @@ msgid "" " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" +" buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -6211,7 +6212,8 @@ msgid "" " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" -" /autojoin sort" +" /autojoin sort\n" +" /autojoin sort buffer" msgstr "" msgid "ban nicks or hosts" diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 4733750b7..2e8f1c06c 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -910,6 +910,7 @@ IRC_COMMAND_CALLBACK(autojoin) struct t_irc_channel *ptr_channel2; const char *ptr_autojoin; char *old_autojoin, *autojoin; + enum t_irc_join_sort sort; int i; IRC_BUFFER_GET_SERVER_CHANNEL(buffer); @@ -1025,7 +1026,9 @@ IRC_COMMAND_CALLBACK(autojoin) /* sort channels */ if (weechat_strcmp (argv[1], "sort") == 0) { - irc_join_sort_autojoin (ptr_server); + sort = ((argc > 2) && (weechat_strcmp (argv[2], "buffer") == 0)) ? + IRC_JOIN_SORT_BUFFER : IRC_JOIN_SORT_ALPHA; + irc_join_sort_autojoin (ptr_server, sort); goto end; } @@ -6889,7 +6892,7 @@ irc_command_init () " || del [ [...]]" " || apply" " || join" - " || sort"), + " || sort [buffer]"), N_(" add: add current channel or a list of channels (with optional " "keys) to the autojoin option; if you are on the channel and the " "key is not provided, the key is read in the channel\n" @@ -6902,6 +6905,7 @@ irc_command_init () " apply: set currently joined channels in the autojoin option\n" " join: join the channels in the autojoin option\n" " sort: sort alphabetically channels in the autojoin option\n" + " buffer: sort channels by order of buffers in the autojoin option\n" "\n" "Examples:\n" " /autojoin add\n" @@ -6913,13 +6917,14 @@ irc_command_init () " /autojoin del #chan1\n" " /autojoin apply\n" " /autojoin join\n" - " /autojoin sort"), + " /autojoin sort\n" + " /autojoin sort buffer"), "add %(irc_channels)|%*" " || addraw %(irc_channels) %-" " || del %(irc_channels_autojoin)|%*" " || apply" " || join" - " || sort", + " || sort buffer", &irc_command_autojoin, NULL, NULL); weechat_hook_command_run ("/away", &irc_command_run_away, NULL, NULL); weechat_hook_command ( diff --git a/src/plugins/irc/irc-join.c b/src/plugins/irc/irc-join.c index dd4324eb7..0707cb725 100644 --- a/src/plugins/irc/irc-join.c +++ b/src/plugins/irc/irc-join.c @@ -59,7 +59,7 @@ irc_join_compare_join_channel (struct t_irc_server *server, } /* - * Compares two join channels (no sort, keyed channels first). + * Compares two join channels: no sort, keyed channels first. */ int @@ -97,12 +97,12 @@ irc_join_compare_cb (void *data, struct t_arraylist *arraylist, } /* - * Compares two join channels (alphabetic sort, keyed channels first). + * Compares two join channels: alphabetic sort, keyed channels first. */ int -irc_join_compare_sort_cb (void *data, struct t_arraylist *arraylist, - void *pointer1, void *pointer2) +irc_join_compare_sort_alpha_cb (void *data, struct t_arraylist *arraylist, + void *pointer1, void *pointer2) { struct t_irc_server *server; struct t_irc_join_channel *ptr_join_chan1, *ptr_join_chan2; @@ -134,6 +134,59 @@ irc_join_compare_sort_cb (void *data, struct t_arraylist *arraylist, return rc; } +/* + * Compares two join channels: buffer sort, then alphabetic, + * keyed channels first. + */ + +int +irc_join_compare_sort_buffer_cb (void *data, struct t_arraylist *arraylist, + void *pointer1, void *pointer2) +{ + struct t_irc_server *server; + struct t_irc_channel *ptr_channel1, *ptr_channel2; + struct t_irc_join_channel *ptr_join_chan1, *ptr_join_chan2; + int rc, buffer_num1, buffer_num2; + + /* make C compiler happy */ + (void) arraylist; + + server = (struct t_irc_server *)data; + + ptr_join_chan1 = (struct t_irc_join_channel *)pointer1; + ptr_join_chan2 = (struct t_irc_join_channel *)pointer2; + + /* + * if channel is the same, always consider it's the same, even if the key + * is different + */ + rc = irc_server_strcasecmp (server, ptr_join_chan1->name, + ptr_join_chan2->name); + if (rc == 0) + return 0; + + /* channels with a key are first in list */ + if (ptr_join_chan1->key && !ptr_join_chan2->key) + return -1; + if (!ptr_join_chan1->key && ptr_join_chan2->key) + return 1; + + /* search buffer number for each channel */ + ptr_channel1 = irc_channel_search (server, ptr_join_chan1->name); + buffer_num1 = (ptr_channel1 && ptr_channel1->buffer) ? + weechat_buffer_get_integer (ptr_channel1->buffer, "number") : INT_MAX; + ptr_channel2 = irc_channel_search (server, ptr_join_chan2->name); + buffer_num2 = (ptr_channel2 && ptr_channel2->buffer) ? + weechat_buffer_get_integer (ptr_channel2->buffer, "number") : INT_MAX; + if (buffer_num1 < buffer_num2) + return -1; + if (buffer_num1 > buffer_num2) + return 1; + + /* same buffer number: fallback on alphabetic sort */ + return rc; +} + /* * Frees a join channel. */ @@ -242,19 +295,22 @@ irc_join_arraylist_add (struct t_arraylist *arraylist, * * #channel1,#channel2,#channel3 key1,key2 * - * If sort == 1, channels are sorted alphabetically, otherwise in the order - * they are received. - * In all cases, keyed channels are first in list. + * Parameter sort can be (in all cases, keyed channels are first in list): + * IRC_JOIN_SORT_DISABLED: no sort + * IRC_JOIN_SORT_ALPHA: alphabetic sort + * IRC_JOIN_SORT_BUFFER: sort by buffer number, then alphabetic */ struct t_arraylist * -irc_join_split (struct t_irc_server *server, const char *join, int sort) +irc_join_split (struct t_irc_server *server, const char *join, + enum t_irc_join_sort sort) { struct t_arraylist *arraylist; char **items, **channels, **keys; int count_items, count_channels, count_keys, i; const char *ptr_channels, *ptr_keys; struct t_irc_join_channel *new_channel; + void *sort_cb; arraylist = NULL; items = NULL; @@ -292,12 +348,22 @@ irc_join_split (struct t_irc_server *server, const char *join, int sort) 0, &count_keys); } - arraylist = weechat_arraylist_new ( - 16, 1, 0, - (sort) ? &irc_join_compare_sort_cb : &irc_join_compare_cb, - server, - &irc_join_free_cb, - NULL); + switch (sort) + { + case IRC_JOIN_SORT_ALPHA: + sort_cb = &irc_join_compare_sort_alpha_cb; + break; + case IRC_JOIN_SORT_BUFFER: + sort_cb = &irc_join_compare_sort_buffer_cb; + break; + default: + sort_cb = &irc_join_compare_cb; + break; + } + + arraylist = weechat_arraylist_new (16, 1, 0, + sort_cb, server, + &irc_join_free_cb, NULL); if (!arraylist) goto end; @@ -807,12 +873,13 @@ irc_join_save_channels_to_autojoin (struct t_irc_server *server) */ char * -irc_join_sort_channels (struct t_irc_server *server, const char *join) +irc_join_sort_channels (struct t_irc_server *server, const char *join, + enum t_irc_join_sort sort) { struct t_arraylist *arraylist; char *new_join; - arraylist = irc_join_split (server, join, 1); + arraylist = irc_join_split (server, join, sort); if (!arraylist) return NULL; @@ -828,7 +895,7 @@ irc_join_sort_channels (struct t_irc_server *server, const char *join) */ void -irc_join_sort_autojoin (struct t_irc_server *server) +irc_join_sort_autojoin (struct t_irc_server *server, enum t_irc_join_sort sort) { const char *ptr_autojoin; char *new_autojoin; @@ -841,7 +908,7 @@ irc_join_sort_autojoin (struct t_irc_server *server) if (!ptr_autojoin || !ptr_autojoin[0]) return; - new_autojoin = irc_join_sort_channels (server, ptr_autojoin); + new_autojoin = irc_join_sort_channels (server, ptr_autojoin, sort); if (new_autojoin) { weechat_config_option_set (server->options[IRC_SERVER_OPTION_AUTOJOIN], diff --git a/src/plugins/irc/irc-join.h b/src/plugins/irc/irc-join.h index 3da75d87f..6fd238a3e 100644 --- a/src/plugins/irc/irc-join.h +++ b/src/plugins/irc/irc-join.h @@ -20,17 +20,26 @@ #ifndef WEECHAT_PLUGIN_IRC_JOIN_H #define WEECHAT_PLUGIN_IRC_JOIN_H +enum t_irc_join_sort +{ + IRC_JOIN_SORT_DISABLED = 0, /* no sort */ + IRC_JOIN_SORT_ALPHA, /* alphabetic sort */ + IRC_JOIN_SORT_BUFFER, /* sort by buffer number, then alpha */ + /* number of sort methods */ + IRC_JOIN_NUM_SORT, +}; + struct t_irc_server; struct t_irc_join_channel { - char *name; /* channel name */ - char *key; /* channel key */ + char *name; /* channel name */ + char *key; /* channel key */ }; extern struct t_arraylist *irc_join_split (struct t_irc_server *server, const char *join, - int sort); + enum t_irc_join_sort sort); extern char *irc_join_build_string (struct t_arraylist *arraylist); extern int irc_join_has_channel (struct t_irc_server *server, const char *join, const char *channel_name); @@ -58,7 +67,9 @@ extern void irc_join_rename_channel_in_autojoin (struct t_irc_server *server, const char *new_channel_name); extern void irc_join_save_channels_to_autojoin (struct t_irc_server *server); extern char *irc_join_sort_channels (struct t_irc_server *server, - const char *join); -extern void irc_join_sort_autojoin (struct t_irc_server *server); + const char *join, + enum t_irc_join_sort sort); +extern void irc_join_sort_autojoin (struct t_irc_server *server, + enum t_irc_join_sort sort); #endif /* WEECHAT_PLUGIN_IRC_JOIN_H */ diff --git a/tests/unit/plugins/irc/test-irc-join.cpp b/tests/unit/plugins/irc/test-irc-join.cpp index ee1b17ebc..59c21c0f4 100644 --- a/tests/unit/plugins/irc/test-irc-join.cpp +++ b/tests/unit/plugins/irc/test-irc-join.cpp @@ -94,7 +94,7 @@ extern int irc_join_compare_join_channel (struct t_irc_server *server, free (str); #define WEE_CHECK_SORT_CHANNELS(__result, __join) \ - str = irc_join_sort_channels (NULL, __join); \ + str = irc_join_sort_channels (NULL, __join, IRC_JOIN_SORT_ALPHA); \ if (__result == NULL) \ { \ POINTERS_EQUAL(NULL, str); \ @@ -166,9 +166,10 @@ TEST(IrcJoin, SplitBuildString) struct t_arraylist *arraylist; struct t_irc_join_channel **channels; struct t_irc_server *server; + struct t_irc_channel *ptr_channel; char *autojoin; - arraylist = irc_join_split (NULL, NULL, 0); + arraylist = irc_join_split (NULL, NULL, IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(0, arraylist->size); autojoin = irc_join_build_string (arraylist); @@ -180,7 +181,7 @@ TEST(IrcJoin, SplitBuildString) STRCMP_EQUAL("", autojoin); free (autojoin); - arraylist = irc_join_split (NULL, "", 0); + arraylist = irc_join_split (NULL, "", IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(0, arraylist->size); autojoin = irc_join_build_string (arraylist); @@ -189,7 +190,8 @@ TEST(IrcJoin, SplitBuildString) arraylist_free (arraylist); /* 1 channel, 2 keys (the second is ignored) */ - arraylist = irc_join_split (NULL, "#xyz key_xyz,key_abc", 0); + arraylist = irc_join_split (NULL, "#xyz key_xyz,key_abc", + IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(1, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -202,7 +204,7 @@ TEST(IrcJoin, SplitBuildString) arraylist_free (arraylist); /* 1 channel */ - arraylist = irc_join_split (NULL, "#xyz", 0); + arraylist = irc_join_split (NULL, "#xyz", IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(1, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -215,7 +217,7 @@ TEST(IrcJoin, SplitBuildString) arraylist_free (arraylist); /* 2 channels */ - arraylist = irc_join_split (NULL, "#xyz,#abc", 0); + arraylist = irc_join_split (NULL, "#xyz,#abc", IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(2, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -230,7 +232,8 @@ TEST(IrcJoin, SplitBuildString) arraylist_free (arraylist); /* 2 channels, 2 keys */ - arraylist = irc_join_split (NULL, "#xyz,#abc key_xyz,key_abc", 0); + arraylist = irc_join_split (NULL, "#xyz,#abc key_xyz,key_abc", + IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(2, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -245,7 +248,8 @@ TEST(IrcJoin, SplitBuildString) arraylist_free (arraylist); /* 3 channels, 2 keys */ - arraylist = irc_join_split (NULL, "#xyz,#abc,#def key_xyz,key_abc", 0); + arraylist = irc_join_split (NULL, "#xyz,#abc,#def key_xyz,key_abc", + IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(3, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -262,7 +266,7 @@ TEST(IrcJoin, SplitBuildString) arraylist_free (arraylist); /* duplicated channel */ - arraylist = irc_join_split (NULL, "#xyz,#XYZ", 0); + arraylist = irc_join_split (NULL, "#xyz,#XYZ", IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(1, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -275,7 +279,7 @@ TEST(IrcJoin, SplitBuildString) arraylist_free (arraylist); /* duplicated channel */ - arraylist = irc_join_split (NULL, "#abc,#def,#abc", 0); + arraylist = irc_join_split (NULL, "#abc,#def,#abc", IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(2, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -294,7 +298,8 @@ TEST(IrcJoin, SplitBuildString) server = irc_server_alloc ("my_ircd"); CHECK(server); server->casemapping = IRC_SERVER_CASEMAPPING_RFC1459; - arraylist = irc_join_split (server, "#chan[a]^,#CHAN{A}~", 0); + arraylist = irc_join_split (server, "#chan[a]^,#CHAN{A}~", + IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(1, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -311,7 +316,8 @@ TEST(IrcJoin, SplitBuildString) server = irc_server_alloc ("my_ircd"); CHECK(server); server->casemapping = IRC_SERVER_CASEMAPPING_STRICT_RFC1459; - arraylist = irc_join_split (server, "#chan[a]^,#CHAN{A}~", 0); + arraylist = irc_join_split (server, "#chan[a]^,#CHAN{A}~", + IRC_JOIN_SORT_DISABLED); CHECK(arraylist); LONGS_EQUAL(2, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -326,12 +332,13 @@ TEST(IrcJoin, SplitBuildString) arraylist_free (arraylist); irc_server_free (server); - /* server with casemapping RFC1459, sort channels */ + /* server with casemapping RFC1459, sort channels alphabetically */ server = irc_server_alloc ("my_ircd"); CHECK(server); server->casemapping = IRC_SERVER_CASEMAPPING_RFC1459; arraylist = irc_join_split ( - server, "#xyz,#def,#abc,#chan[a]^,#CHAN{A}~ key_xyz", 1); + server, "#xyz,#def,#abc,#chan[a]^,#CHAN{A}~ key_xyz", + IRC_JOIN_SORT_ALPHA); CHECK(arraylist); LONGS_EQUAL(4, arraylist->size); channels = (struct t_irc_join_channel **)arraylist->data; @@ -349,6 +356,43 @@ TEST(IrcJoin, SplitBuildString) free (autojoin); arraylist_free (arraylist); irc_server_free (server); + + /* server with casemapping RFC1459, sort channels by buffer number */ + server = irc_server_alloc ("my_ircd"); + CHECK(server); + server->casemapping = IRC_SERVER_CASEMAPPING_RFC1459; + irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, "#CHAN{A}~", 0, 0); + irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, "#def", 0, 0); + irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, "#abc", 0, 0); + irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, "#xyz", 0, 0); + arraylist = irc_join_split ( + server, "#xyz,#abc,#def,#chan[a]^,#zzz,#CHAN{A}~ key_xyz", + IRC_JOIN_SORT_BUFFER); + CHECK(arraylist); + LONGS_EQUAL(5, arraylist->size); + channels = (struct t_irc_join_channel **)arraylist->data; + CHECK(channels[0]); + STRCMP_EQUAL("#xyz", channels[0]->name); + STRCMP_EQUAL("key_xyz", channels[0]->key); + STRCMP_EQUAL("#CHAN{A}~", channels[1]->name); + POINTERS_EQUAL(NULL, channels[1]->key); + STRCMP_EQUAL("#def", channels[2]->name); + POINTERS_EQUAL(NULL, channels[2]->key); + STRCMP_EQUAL("#abc", channels[3]->name); + POINTERS_EQUAL(NULL, channels[3]->key); + STRCMP_EQUAL("#zzz", channels[4]->name); + POINTERS_EQUAL(NULL, channels[4]->key); + autojoin = irc_join_build_string (arraylist); + STRCMP_EQUAL("#xyz,#CHAN{A}~,#def,#abc,#zzz key_xyz", autojoin); + free (autojoin); + arraylist_free (arraylist); + for (ptr_channel = server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) + { + if (ptr_channel->buffer) + gui_buffer_close (ptr_channel->buffer); + } + irc_server_free (server); } /* @@ -765,7 +809,7 @@ TEST(IrcJoin, SortAutojoinChannels) STRCMP_EQUAL("#zzz,#xyz,#ghi,#def,#ABC key_zzz,key_xyz", CONFIG_STRING(server->options[IRC_SERVER_OPTION_AUTOJOIN])); - irc_join_sort_autojoin (server); + irc_join_sort_autojoin (server, IRC_JOIN_SORT_ALPHA); STRCMP_EQUAL("#xyz,#zzz,#ABC,#def,#ghi key_xyz,key_zzz", CONFIG_STRING(server->options[IRC_SERVER_OPTION_AUTOJOIN]));