1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06:38 +02:00

irc: add command /remove (closes #91)

This commit is contained in:
Sébastien Helleu
2014-05-26 07:57:38 +02:00
parent 74c979d9ac
commit 34098cee27
14 changed files with 134 additions and 13 deletions
+1
View File
@@ -124,6 +124,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* irc: add option irc.color.item_nick_modes (closes #47)
* irc: allow "$ident" in option irc.network.ban_mask_default (closes #18)
* irc: add support of "away-notify" capability (closes #12)
* irc: add command /remove (closes #91)
* irc: add command /unquiet (closes #36)
* irc: add command /allpv (task #13111)
* irc: fix truncated read on socket with SSL (bug #41558)
+5 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6039,6 +6039,10 @@ msgstr "[<volba>]"
msgid "option: extra option, for some servers"
msgstr "volba: extra volba pro některé servery"
#, fuzzy
msgid "remove a user from the channel"
msgstr "násilně odebrat uživatele z kanálu"
msgid "tell the server to restart itself"
msgstr "říct serveru, aby se restartoval"
+5 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-05-24 22:41+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -6901,6 +6901,10 @@ msgid "option: extra option, for some servers"
msgstr ""
"option: zusätzliche Option, die von manchen Servern berücksichtigt wird"
#, fuzzy
msgid "remove a user from the channel"
msgstr "Einen User aus einem Channel herauswerfen"
msgid "tell the server to restart itself"
msgstr "Server dazu bringen sich selbst neu zu starten"
+5 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6272,6 +6272,10 @@ msgstr "[<opción>]"
msgid "option: extra option, for some servers"
msgstr "opción: opción extra, para algunos servidores"
#, fuzzy
msgid "remove a user from the channel"
msgstr "expulsar forzosamente a un usuario de un canal"
msgid "tell the server to restart itself"
msgstr "pedir al servidor que se reinicie"
+5 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"PO-Revision-Date: 2014-05-24 18:04+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-05-26 07:51+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -6759,6 +6759,9 @@ msgstr "[<option>]"
msgid "option: extra option, for some servers"
msgstr "option : option supplémentaire, pour certains serveurs"
msgid "remove a user from the channel"
msgstr "supprimer un utilisateur du canal"
msgid "tell the server to restart itself"
msgstr "demander au serveur de redémarrer"
+5 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5509,6 +5509,10 @@ msgstr "[parancs]"
msgid "option: extra option, for some servers"
msgstr ""
#, fuzzy
msgid "remove a user from the channel"
msgstr "felhasználó erőszakos eltávolítása a szobából"
msgid "tell the server to restart itself"
msgstr "szerver újraindítása"
+5 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6411,6 +6411,10 @@ msgstr "[<opzione>]"
msgid "option: extra option, for some servers"
msgstr "opzione: opzione extra, per alcuni server"
#, fuzzy
msgid "remove a user from the channel"
msgstr "caccia forzatamente un utente da un canale"
msgid "tell the server to restart itself"
msgstr "chiede al server di riavviarsi"
+5 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-05-15 12:40+0900\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n"
@@ -6488,6 +6488,10 @@ msgstr "[<option>]"
msgid "option: extra option, for some servers"
msgstr "option: 追加オプション、いくつかのサーバ用"
#, fuzzy
msgid "remove a user from the channel"
msgstr "チャンネルからユーザを強制的に削除"
msgid "tell the server to restart itself"
msgstr "サーバに再起動を指示"
+5 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6545,6 +6545,10 @@ msgstr "[<opcja>]"
msgid "option: extra option, for some servers"
msgstr "opcje: dodatkowe opcje, dla niektórych serwerów"
#, fuzzy
msgid "remove a user from the channel"
msgstr "siłowo usuwa użytkownika z kanału"
msgid "tell the server to restart itself"
msgstr "mówi serwerowi, aby się ponownie uruchomił"
+5 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5847,6 +5847,10 @@ msgstr "[<opção>]"
msgid "option: extra option, for some servers"
msgstr "opção: opção extra, para alguns servidores"
#, fuzzy
msgid "remove a user from the channel"
msgstr "forçar um usuário a deixar algum(s) canal(is)"
msgid "tell the server to restart itself"
msgstr "requisitar ao servidor para reiniciar a si mesmo"
+5 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5540,6 +5540,10 @@ msgstr "[команда]"
msgid "option: extra option, for some servers"
msgstr ""
#, fuzzy
msgid "remove a user from the channel"
msgstr "принудительно удалить пользователя с канала"
msgid "tell the server to restart itself"
msgstr "перезагрузить сервер"
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2014-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2014-03-24 14:23+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4943,6 +4943,9 @@ msgstr "[<seçenek>]"
msgid "option: extra option, for some servers"
msgstr ""
msgid "remove a user from the channel"
msgstr ""
msgid "tell the server to restart itself"
msgstr ""
+4 -1
View File
@@ -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-05-24 18:00+0200\n"
"POT-Creation-Date: 2014-05-26 07:50+0200\n"
"PO-Revision-Date: 2013-02-14 18:20+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4930,6 +4930,9 @@ msgstr ""
msgid "option: extra option, for some servers"
msgstr ""
msgid "remove a user from the channel"
msgstr ""
msgid "tell the server to restart itself"
msgstr ""
+75
View File
@@ -4043,6 +4043,72 @@ irc_command_rehash (void *data, struct t_gui_buffer *buffer, int argc,
return WEECHAT_RC_OK;
}
/*
* Callback for command "/remove": remove a user from a channel.
*/
int
irc_command_remove (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
const char *ptr_channel_name;
char *msg_vars_replaced;
int index_nick;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("remove", 1);
/* make C compiler happy */
(void) data;
if (argc < 2)
return WEECHAT_RC_ERROR;
ptr_channel_name = (ptr_channel) ? ptr_channel->name : NULL;
index_nick = 1;
if (irc_channel_is_channel (ptr_server, argv[1]))
{
if (argc < 3)
return WEECHAT_RC_ERROR;
ptr_channel_name = argv[1];
index_nick = 2;
}
if (!ptr_channel_name)
{
weechat_printf (ptr_server->buffer,
_("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
weechat_prefix ("error"), IRC_PLUGIN_NAME,
"remove");
return WEECHAT_RC_OK;
}
if (argc > index_nick + 1)
{
msg_vars_replaced = irc_message_replace_vars (ptr_server,
ptr_channel_name,
argv_eol[index_nick + 1]);
irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
"REMOVE %s %s :%s",
ptr_channel_name,
argv[index_nick],
(msg_vars_replaced) ? msg_vars_replaced : argv_eol[index_nick + 1]);
if (msg_vars_replaced)
free (msg_vars_replaced);
}
else
{
irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
"REMOVE %s %s",
ptr_channel_name,
argv[index_nick]);
}
return WEECHAT_RC_OK;
}
/*
* Callback for command "/restart": tells the server to restart itself.
*/
@@ -6239,6 +6305,15 @@ irc_command_init ()
N_("[<option>]"),
N_("option: extra option, for some servers"),
NULL, &irc_command_rehash, NULL);
weechat_hook_command (
"remove",
N_("remove a user from the channel"),
N_("[<channel>] <nick> [<reason>]"),
N_("channel: channel name\n"
" nick: nick\n"
" reason: reason (special variables $nick, $channel and $server are "
"replaced by their value)"),
"%(irc_channel)|%(nicks) %(nicks)", &irc_command_remove, NULL);
weechat_hook_command (
"restart",
N_("tell the server to restart itself"),