From c9116e49822c26df0aa4caeba0daa18631df2d7f Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 22 Mar 2014 09:30:04 +0100 Subject: [PATCH] irc: add command /unquiet (closes #36) --- ChangeLog.asciidoc | 1 + doc/de/autogen/user/irc_commands.txt | 10 ++++ doc/en/autogen/user/irc_commands.txt | 10 ++++ doc/fr/autogen/user/irc_commands.txt | 10 ++++ doc/it/autogen/user/irc_commands.txt | 10 ++++ doc/ja/autogen/user/irc_commands.txt | 10 ++++ doc/pl/autogen/user/irc_commands.txt | 10 ++++ po/cs.po | 14 ++++- po/de.po | 16 +++++- po/es.po | 14 ++++- po/fr.po | 17 +++++-- po/hu.po | 14 ++++- po/it.po | 14 ++++- po/ja.po | 14 ++++- po/pl.po | 14 ++++- po/pt_BR.po | 11 +++- po/ru.po | 14 ++++- po/tr.po | 10 +++- po/weechat.pot | 10 +++- src/plugins/irc/irc-command.c | 76 ++++++++++++++++++++++++++++ 20 files changed, 284 insertions(+), 15 deletions(-) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index d4f3072fa..42461cfab 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -74,6 +74,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * alias: change default command for alias /beep to "/print -beep" * exec: add exec plugin: new command /exec and file exec.conf * guile: fix module used after unload of a script +* irc: add command /unquiet (closes #36) * irc: add command /allpv (task #13111) * irc: fix truncated read on socket with SSL (bug #41558) * irc: add "#" before any channel in /join, even /join 0 (closes #20) diff --git a/doc/de/autogen/user/irc_commands.txt b/doc/de/autogen/user/irc_commands.txt index d370a2ddc..6794354d2 100644 --- a/doc/de/autogen/user/irc_commands.txt +++ b/doc/de/autogen/user/irc_commands.txt @@ -794,6 +794,16 @@ channel: Channel in dem der Bann aufzuheben ist nick: User oder Host für den der Bann aufzuheben ist ---- +[[command_irc_unquiet]] +[command]*`unquiet`* unquiet nicks or hosts:: + +---- +/unquiet [] [ [...]] + +channel: channel for unquiet + nick: user or host to unquiet +---- + [[command_irc_userhost]] [command]*`userhost`* Zeigt Informationen zu Nicknamen an:: diff --git a/doc/en/autogen/user/irc_commands.txt b/doc/en/autogen/user/irc_commands.txt index 2145556da..b29ce6001 100644 --- a/doc/en/autogen/user/irc_commands.txt +++ b/doc/en/autogen/user/irc_commands.txt @@ -794,6 +794,16 @@ channel: channel for unban nick: user or host to unban ---- +[[command_irc_unquiet]] +[command]*`unquiet`* unquiet nicks or hosts:: + +---- +/unquiet [] [ [...]] + +channel: channel for unquiet + nick: user or host to unquiet +---- + [[command_irc_userhost]] [command]*`userhost`* return a list of information about nicks:: diff --git a/doc/fr/autogen/user/irc_commands.txt b/doc/fr/autogen/user/irc_commands.txt index c0f2557da..1e0dff14e 100644 --- a/doc/fr/autogen/user/irc_commands.txt +++ b/doc/fr/autogen/user/irc_commands.txt @@ -794,6 +794,16 @@ cible: serveur pseudo: pseudo ou hôte pour supprimer le bannissement ---- +[[command_irc_unquiet]] +[command]*`unquiet`* ne plus taire des pseudos ou hôtes:: + +---- +/unquiet [] [ [...]] + + canal: nom du canal pour ne plus taire +pseudo: pseudo ou hôte à ne plus taire +---- + [[command_irc_userhost]] [command]*`userhost`* retourner une liste d'informations sur des pseudos:: diff --git a/doc/it/autogen/user/irc_commands.txt b/doc/it/autogen/user/irc_commands.txt index 370bdf8af..792d0871f 100644 --- a/doc/it/autogen/user/irc_commands.txt +++ b/doc/it/autogen/user/irc_commands.txt @@ -794,6 +794,16 @@ canale: canale da cui rimuovere il ban nick: utente o host a cui rimuovere il ban ---- +[[command_irc_unquiet]] +[command]*`unquiet`* unquiet nicks or hosts:: + +---- +/unquiet [] [ [...]] + +channel: channel for unquiet + nick: user or host to unquiet +---- + [[command_irc_userhost]] [command]*`userhost`* restituisce un elenco di informazioni sui nick:: diff --git a/doc/ja/autogen/user/irc_commands.txt b/doc/ja/autogen/user/irc_commands.txt index ed3796aec..c2f652801 100644 --- a/doc/ja/autogen/user/irc_commands.txt +++ b/doc/ja/autogen/user/irc_commands.txt @@ -794,6 +794,16 @@ channel: 禁止設定を解除するチャンネル nick: 禁止設定を解除するユーザかホスト ---- +[[command_irc_unquiet]] +[command]*`unquiet`* unquiet nicks or hosts:: + +---- +/unquiet [] [ [...]] + +channel: channel for unquiet + nick: user or host to unquiet +---- + [[command_irc_userhost]] [command]*`userhost`* ニックネームに関する情報のリストを返す:: diff --git a/doc/pl/autogen/user/irc_commands.txt b/doc/pl/autogen/user/irc_commands.txt index 723781caa..ea25b90af 100644 --- a/doc/pl/autogen/user/irc_commands.txt +++ b/doc/pl/autogen/user/irc_commands.txt @@ -793,6 +793,16 @@ kanał: kanał, na którym zdejmujemy bana nick: użytkownik lub host do odbanowania ---- +[[command_irc_unquiet]] +[command]*`unquiet`* unquiet nicks or hosts:: + +---- +/unquiet [] [ [...]] + +channel: channel for unquiet + nick: user or host to unquiet +---- + [[command_irc_userhost]] [command]*`userhost`* zwraca listę informacji o użytkownikach:: diff --git a/po/cs.po b/po/cs.po index d1e587a55..64f1ee284 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-21 13:45+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -6248,6 +6248,18 @@ msgstr "" " kanál: kanál pro zrušení zakázání\n" "přezdívka: uživatel nebo host, kterému zrušit zakázání" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "zruší zakázání pro přezdívku nebo hosta" + +#, fuzzy +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +" kanál: kanál pro zrušení zakázání\n" +"přezdívka: uživatel nebo host, kterému zrušit zakázání" + msgid "return a list of information about nicks" msgstr "vrátí seznam informací o přezdívkách" diff --git a/po/de.po b/po/de.po index f3b7b65cd..5c2f1f7bb 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-21 13:45+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -7116,6 +7116,20 @@ msgstr "" "channel: Channel in dem der Bann aufzuheben ist\n" " nick: User oder Host für den der Bann aufzuheben ist" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "" +"Nicks oder Hosts das Wort entziehen (User können im Channel erst schreiben, " +"wenn sie \"+v\" oder höher besitzen)" + +#, fuzzy +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +"channel: Channel in dem der Bann aufzuheben ist\n" +" nick: User oder Host für den der Bann aufzuheben ist" + msgid "return a list of information about nicks" msgstr "Zeigt Informationen zu Nicknamen an" diff --git a/po/es.po b/po/es.po index b7a138890..2b16177da 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: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-21 13:46+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -6476,6 +6476,18 @@ msgstr "" "canal: canal donde remover el veto\n" "apodo: apodo o host con el veto" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "silencia apodos o máquinas" + +#, fuzzy +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +"canal: canal donde remover el veto\n" +"apodo: apodo o host con el veto" + msgid "return a list of information about nicks" msgstr "devuelve una lista con información sobre los apodos" diff --git a/po/fr.po b/po/fr.po index a38dd4820..c6d03ac65 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: 2014-03-21 13:43+0100\n" -"PO-Revision-Date: 2014-03-21 13:45+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" +"PO-Revision-Date: 2014-03-22 09:27+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -6660,8 +6660,7 @@ msgstr "" " canal: nom du canal pour faire taire\n" "pseudo: pseudo ou hôte à faire taire\n" "\n" -"Sans paramètre, cette commande affiche la liste des \"quiet\" pour le canal " -"courant." +"Sans paramètre, cette commande affiche la liste des \"quiet\" pour le canal courant." msgid "send raw data to server without parsing" msgstr "envoyer des données brutes au serveur sans analyse" @@ -6954,6 +6953,16 @@ msgstr "" " canal: nom du canal pour supprimer le bannissement\n" "pseudo: pseudo ou hôte pour supprimer le bannissement" +msgid "unquiet nicks or hosts" +msgstr "ne plus taire des pseudos ou hôtes" + +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +" canal: nom du canal pour ne plus taire\n" +"pseudo: pseudo ou hôte à ne plus taire" + msgid "return a list of information about nicks" msgstr "retourner une liste d'informations sur des pseudos" diff --git a/po/hu.po b/po/hu.po index c01ebe613..265c90d71 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: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-10 21:07+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -5764,6 +5764,18 @@ msgstr "" "szoba: szoba ahol a parancsot végrehajtjuk\n" " név: felhasználó vagy gép melyen a parancsot végrehajtjuk" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "gép vagy felhasználó tiltásának visszavonása" + +#, fuzzy +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +"szoba: szoba ahol a parancsot végrehajtjuk\n" +" név: felhasználó vagy gép melyen a parancsot végrehajtjuk" + #, fuzzy msgid "return a list of information about nicks" msgstr "információt ad a kívánt felhasználókról" diff --git a/po/it.po b/po/it.po index 96ec33cb9..8548ec858 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: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-21 13:46+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -6610,6 +6610,18 @@ msgstr "" "canale: canale da cui rimuovere il ban\n" " nick: utente o host a cui rimuovere il ban" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "fa tacere nick o host" + +#, fuzzy +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +"canale: canale da cui rimuovere il ban\n" +" nick: utente o host a cui rimuovere il ban" + msgid "return a list of information about nicks" msgstr "restituisce un elenco di informazioni sui nick" diff --git a/po/ja.po b/po/ja.po index 6e4409692..f77546dc9 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: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-21 13:46+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -6701,6 +6701,18 @@ msgstr "" "channel: 禁止設定を解除するチャンネル\n" " nick: 禁止設定を解除するユーザかホスト" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "ニックネームかホストを発言禁止に" + +#, fuzzy +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +"channel: 禁止設定を解除するチャンネル\n" +" nick: 禁止設定を解除するユーザかホスト" + msgid "return a list of information about nicks" msgstr "ニックネームに関する情報のリストを返す" diff --git a/po/pl.po b/po/pl.po index 37434a98c..654980328 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-21 13:47+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -6746,6 +6746,18 @@ msgstr "" "kanał: kanał, na którym zdejmujemy bana\n" " nick: użytkownik lub host do odbanowania" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "ucisza nicki albo hosty" + +#, fuzzy +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +"kanał: kanał, na którym zdejmujemy bana\n" +" nick: użytkownik lub host do odbanowania" + msgid "return a list of information about nicks" msgstr "zwraca listę informacji o użytkownikach" diff --git a/po/pt_BR.po b/po/pt_BR.po index b388a9651..a864de98e 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: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-21 13:47+0100\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -5997,6 +5997,15 @@ msgid "" " nick: user or host to unban" msgstr "" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "obter apelido de host IRC" + +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" + msgid "return a list of information about nicks" msgstr "" diff --git a/po/ru.po b/po/ru.po index 6069b319c..d57f55e9e 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: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-10 21:07+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -5792,6 +5792,18 @@ msgstr "" "канал: канал для снятия бана\n" " ник: ник или хост для снятия бана" +#, fuzzy +msgid "unquiet nicks or hosts" +msgstr "снимает бан с хоста или ника" + +#, fuzzy +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" +"канал: канал для снятия бана\n" +" ник: ник или хост для снятия бана" + #, fuzzy msgid "return a list of information about nicks" msgstr "возвращает список информации о никах" diff --git a/po/tr.po b/po/tr.po index 0f12a4ec7..694a4937c 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: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2014-03-18 09:23+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -5143,6 +5143,14 @@ msgid "" " nick: user or host to unban" msgstr "" +msgid "unquiet nicks or hosts" +msgstr "" + +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" + msgid "return a list of information about nicks" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index 4c948735e..0035d5e64 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-21 13:43+0100\n" +"POT-Creation-Date: 2014-03-22 09:22+0100\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: weechat-dev \n" @@ -5097,6 +5097,14 @@ msgid "" " nick: user or host to unban" msgstr "" +msgid "unquiet nicks or hosts" +msgstr "" + +msgid "" +"channel: channel for unquiet\n" +" nick: user or host to unquiet" +msgstr "" + msgid "return a list of information about nicks" msgstr "" diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 3dd8a2ed3..a0dde2d0a 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -5265,6 +5265,75 @@ irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc, return WEECHAT_RC_OK; } +/* + * Callback for command "/unquiet": unquiets nicks or hosts. + */ + +int +irc_command_unquiet (void *data, struct t_gui_buffer *buffer, int argc, + char **argv, char **argv_eol) +{ + char *pos_channel; + int pos_args; + + IRC_BUFFER_GET_SERVER_CHANNEL(buffer); + IRC_COMMAND_CHECK_SERVER("unquiet", 1); + + /* make C compiler happy */ + (void) data; + (void) argv_eol; + + if (argc < 2) + return WEECHAT_RC_ERROR; + + if (irc_channel_is_channel (ptr_server, argv[1])) + { + pos_channel = argv[1]; + pos_args = 2; + } + else + { + pos_channel = NULL; + pos_args = 1; + } + + /* channel not given, use default buffer */ + if (!pos_channel) + { + if (ptr_channel && (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)) + pos_channel = ptr_channel->name; + else + { + weechat_printf (ptr_server->buffer, + _("%s%s: \"%s\" command can only be " + "executed in a channel buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "unquiet"); + return WEECHAT_RC_OK; + } + } + + if (argv[pos_args]) + { + /* loop on users */ + while (argv[pos_args]) + { + irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "MODE %s -q %s", + pos_channel, argv[pos_args]); + pos_args++; + } + } + else + { + irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "MODE %s -q", + pos_channel); + } + + return WEECHAT_RC_OK; +} + /* * Callback for command "/userhost": returns a list of information about * nicknames. @@ -6332,6 +6401,13 @@ irc_command_init () N_("channel: channel for unban\n" " nick: user or host to unban"), NULL, &irc_command_unban, NULL); + weechat_hook_command ( + "unquiet", + N_("unquiet nicks or hosts"), + N_("[] [ [...]]"), + N_("channel: channel for unquiet\n" + " nick: user or host to unquiet"), + "%(irc_channel_nicks_hosts)", &irc_command_unquiet, NULL); weechat_hook_command ( "userhost", N_("return a list of information about nicks"),