From 30fa647700e9e0eec7465c3dfffe270a55deb3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 31 Jan 2023 18:43:07 +0100 Subject: [PATCH] irc: add command `/rules` (closes #1864) --- ChangeLog.adoc | 1 + doc/de/includes/autogen_user_commands.de.adoc | 6 ++++ doc/en/includes/autogen_user_commands.en.adoc | 6 ++++ doc/fr/includes/autogen_user_commands.fr.adoc | 6 ++++ doc/it/includes/autogen_user_commands.it.adoc | 6 ++++ doc/ja/includes/autogen_user_commands.ja.adoc | 6 ++++ doc/pl/includes/autogen_user_commands.pl.adoc | 6 ++++ doc/sr/includes/autogen_user_commands.sr.adoc | 6 ++++ po/cs.po | 7 ++++- po/de.po | 7 ++++- po/es.po | 7 ++++- po/fr.po | 7 +++-- po/hu.po | 7 ++++- po/it.po | 7 ++++- po/ja.po | 7 ++++- po/pl.po | 7 ++++- po/pt.po | 7 ++++- po/pt_BR.po | 7 ++++- po/ru.po | 7 ++++- po/sr.po | 7 ++++- po/tr.po | 7 ++++- po/weechat.pot | 5 +++- src/plugins/irc/irc-command.c | 28 +++++++++++++++++++ 23 files changed, 152 insertions(+), 15 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 13d5b743e..10c47d158 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -24,6 +24,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 command `/rules` (issue #1864) * 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` diff --git a/doc/de/includes/autogen_user_commands.de.adoc b/doc/de/includes/autogen_user_commands.de.adoc index f51b5c381..4437226d4 100644 --- a/doc/de/includes/autogen_user_commands.de.adoc +++ b/doc/de/includes/autogen_user_commands.de.adoc @@ -757,6 +757,12 @@ channel: Kanalname target: Servername ---- +[[command_irc_rules]] +* `+rules+`: request the server rules + +---- +---- + [[command_irc_sajoin]] * `+sajoin+`: fordert einen User auf einen oder mehrere Kanäle zu betreten diff --git a/doc/en/includes/autogen_user_commands.en.adoc b/doc/en/includes/autogen_user_commands.en.adoc index e9e2f9395..fd28ec0fd 100644 --- a/doc/en/includes/autogen_user_commands.en.adoc +++ b/doc/en/includes/autogen_user_commands.en.adoc @@ -757,6 +757,12 @@ channel: channel name target: server name ---- +[[command_irc_rules]] +* `+rules+`: request the server rules + +---- +---- + [[command_irc_sajoin]] * `+sajoin+`: force a user to join channel(s) diff --git a/doc/fr/includes/autogen_user_commands.fr.adoc b/doc/fr/includes/autogen_user_commands.fr.adoc index 18d56c50e..fb0bdce88 100644 --- a/doc/fr/includes/autogen_user_commands.fr.adoc +++ b/doc/fr/includes/autogen_user_commands.fr.adoc @@ -757,6 +757,12 @@ raison : raison (les variables spéciales $nick, $channel et $server sont rempl cible : nom du serveur ---- +[[command_irc_rules]] +* `+rules+`: demander les règles du serveur + +---- +---- + [[command_irc_sajoin]] * `+sajoin+`: forcer un utilisateur à rejoindre un ou plusieurs canaux diff --git a/doc/it/includes/autogen_user_commands.it.adoc b/doc/it/includes/autogen_user_commands.it.adoc index 1656c4b99..307193e5b 100644 --- a/doc/it/includes/autogen_user_commands.it.adoc +++ b/doc/it/includes/autogen_user_commands.it.adoc @@ -757,6 +757,12 @@ channel: channel name destinazione: nome server ---- +[[command_irc_rules]] +* `+rules+`: request the server rules + +---- +---- + [[command_irc_sajoin]] * `+sajoin+`: forza un utente ad entrare su uno o più canali diff --git a/doc/ja/includes/autogen_user_commands.ja.adoc b/doc/ja/includes/autogen_user_commands.ja.adoc index 46650bdac..6766bb810 100644 --- a/doc/ja/includes/autogen_user_commands.ja.adoc +++ b/doc/ja/includes/autogen_user_commands.ja.adoc @@ -757,6 +757,12 @@ channel: channel name target: サーバ名 ---- +[[command_irc_rules]] +* `+rules+`: request the server rules + +---- +---- + [[command_irc_sajoin]] * `+sajoin+`: ユーザがチャンネルへ参加することを強制 diff --git a/doc/pl/includes/autogen_user_commands.pl.adoc b/doc/pl/includes/autogen_user_commands.pl.adoc index 4ef65e838..0211f6ef0 100644 --- a/doc/pl/includes/autogen_user_commands.pl.adoc +++ b/doc/pl/includes/autogen_user_commands.pl.adoc @@ -757,6 +757,12 @@ kanał: nazwa kanału cel: nazwa serwera ---- +[[command_irc_rules]] +* `+rules+`: request the server rules + +---- +---- + [[command_irc_sajoin]] * `+sajoin+`: zmusza użytkownika do wejścia na kanał(y) diff --git a/doc/sr/includes/autogen_user_commands.sr.adoc b/doc/sr/includes/autogen_user_commands.sr.adoc index 38f5170ce..065e95fc2 100644 --- a/doc/sr/includes/autogen_user_commands.sr.adoc +++ b/doc/sr/includes/autogen_user_commands.sr.adoc @@ -757,6 +757,12 @@ message: message to send циљ: име сервера ---- +[[command_irc_rules]] +* `+rules+`: request the server rules + +---- +---- + [[command_irc_sajoin]] * `+sajoin+`: форсирање да корисник приступи канал(у/има) diff --git a/po/cs.po b/po/cs.po index bd0df942e..b3b52adb5 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -7863,6 +7863,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "říct serveru, aby se restartoval" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "znovu připojit k serveru(ům)" + msgid "force a user to join channel(s)" msgstr "násilně připojit uživatele ke kanálu/kanálům" diff --git a/po/de.po b/po/de.po index b6290eb46..79b3223da 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2023-01-31 07:52+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German - Germany \n" @@ -9834,6 +9834,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "Server dazu bringen sich selbst neu zu starten" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "Mit einem oder mehreren Server(n) erneut verbinden" + msgid "force a user to join channel(s)" msgstr "fordert einen User auf einen oder mehrere Kanäle zu betreten" diff --git a/po/es.po b/po/es.po index 300508e24..357632374 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -8449,6 +8449,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "pedir al servidor que se reinicie" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "reconectar al servidor(es)" + msgid "force a user to join channel(s)" msgstr "fuerza un usuario a unirse a un canal o canales" diff --git a/po/fr.po b/po/fr.po index 11c0a1fa1..e46bdc6ba 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-01-31 18:33+0100\n" -"PO-Revision-Date: 2023-01-31 18:35+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" +"PO-Revision-Date: 2023-01-31 18:40+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -9648,6 +9648,9 @@ msgstr "" msgid "tell the server to restart itself" msgstr "demander au serveur de redémarrer" +msgid "request the server rules" +msgstr "demander les règles du serveur" + msgid "force a user to join channel(s)" msgstr "forcer un utilisateur à rejoindre un ou plusieurs canaux" diff --git a/po/hu.po b/po/hu.po index 0a133ec32..431aacc66 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -7347,6 +7347,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "szerver újraindítása" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "újracsatlakozás a szerver(ek)hez" + #, fuzzy msgid "force a user to join channel(s)" msgstr "felhasználó erőszakos eltávolítása a szobából" diff --git a/po/it.po b/po/it.po index c6273ed23..bb1044e06 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -8212,6 +8212,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "chiede al server di riavviarsi" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "riconnette a uno o più server" + msgid "force a user to join channel(s)" msgstr "forza un utente ad entrare su uno o più canali" diff --git a/po/ja.po b/po/ja.po index 0ecd53b6a..fed5ff0e5 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -9757,6 +9757,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "mówi serwerowi, aby się ponownie uruchomił" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "ponownie połącz się z serwerem(ami)" + msgid "force a user to join channel(s)" msgstr "zmusza użytkownika do wejścia na kanał(y)" diff --git a/po/pt.po b/po/pt.po index 9b947fcb7..b76f41c12 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -8990,6 +8990,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "pedir ao servidor para se reiniciar" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "reconectar-se a um servidor" + msgid "force a user to join channel(s)" msgstr "forçar um utilizador a juntar-se a canais" diff --git a/po/pt_BR.po b/po/pt_BR.po index 2e4316539..1c4d2ddc9 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-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -7926,6 +7926,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "requisitar ao servidor para reiniciar a si mesmo" +#, fuzzy +#| msgid "shutdown the server" +msgid "request the server rules" +msgstr "desligar o servidor" + msgid "force a user to join channel(s)" msgstr "forçar o usuário a entrar em algum(s) canal(is)" diff --git a/po/ru.po b/po/ru.po index cbb99a113..f4f02643f 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -7384,6 +7384,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "перезагрузить сервер" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "переподключиться к серверу(-ам)" + #, fuzzy msgid "force a user to join channel(s)" msgstr "принудительно удалить пользователя с канала" diff --git a/po/sr.po b/po/sr.po index 22f464fe6..8d2e8b41b 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-12-05 09:44+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -9935,6 +9935,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "налог серверу да се поново покрене" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "поновно повезивање са сервер(ом/има)" + msgid "force a user to join channel(s)" msgstr "форсирање да корисник приступи канал(у/има)" diff --git a/po/tr.po b/po/tr.po index edc1a6b7d..9c4320c82 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-01-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -9969,6 +9969,11 @@ msgstr "" msgid "tell the server to restart itself" msgstr "sunucuya kendisini yeniden başlatmasını söyle" +#, fuzzy +#| msgid "reconnect to server(s)" +msgid "request the server rules" +msgstr "sunuculara yeniden bağlan" + msgid "force a user to join channel(s)" msgstr "bir kullanıcıyı kanal(lar)a katılmaya zorla" diff --git a/po/weechat.pot b/po/weechat.pot index 3f751480e..9429cb902 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-31 18:33+0100\n" +"POT-Creation-Date: 2023-01-31 18:40+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -6674,6 +6674,9 @@ msgstr "" msgid "tell the server to restart itself" msgstr "" +msgid "request the server rules" +msgstr "" + msgid "force a user to join channel(s)" msgstr "" diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index c48a2fbc5..76003f957 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -4888,6 +4888,28 @@ IRC_COMMAND_CALLBACK(restart) return WEECHAT_RC_OK; } +/* + * Callback for command "/rules": requests the server rules + */ + +IRC_COMMAND_CALLBACK(rules) +{ + IRC_BUFFER_GET_SERVER(buffer); + IRC_COMMAND_CHECK_SERVER("rules", 1, 1); + + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) argc; + (void) argv; + (void) argv_eol; + + irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "RULES"); + + return WEECHAT_RC_OK; +} + /* * Callback for command "/sajoin": forces a user to join channel(s). */ @@ -7433,6 +7455,12 @@ irc_command_init () N_("[]"), N_("target: server name"), NULL, &irc_command_restart, NULL, NULL); + weechat_hook_command ( + "rules", + N_("request the server rules"), + "", + "", + NULL, &irc_command_rules, NULL, NULL); weechat_hook_command ( "sajoin", N_("force a user to join channel(s)"),