From cc774d099b16280775b86173541c43f54a38fa71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 9 Jul 2015 20:35:27 +0200 Subject: [PATCH] irc: do not allow command /query with a channel name (closes #459) --- ChangeLog.asciidoc | 1 + po/cs.po | 6 +++++- po/de.po | 6 +++++- po/es.po | 6 +++++- po/fr.po | 10 ++++++++-- po/hu.po | 6 +++++- po/it.po | 7 ++++++- po/ja.po | 6 +++++- po/pl.po | 6 +++++- po/pt_BR.po | 6 +++++- po/ru.po | 6 +++++- po/tr.po | 6 +++++- po/weechat.pot | 6 +++++- src/plugins/irc/irc-command.c | 12 ++++++++++++ 14 files changed, 77 insertions(+), 13 deletions(-) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 1b8bbb5fd..fdf64c5ac 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -45,6 +45,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * api: fix type of value returned by function strcasestr * fifo: fix send error on Cygwin when something is received in the pipe (closes #436) +* irc: do not allow command /query with a channel name (closes #459) * irc: decode/encode only text in IRC messages and not the headers (bug #29886, closes #218, closes #451) * irc: fix crash with commands /allchan, /allpv and /allserv if the executed diff --git a/po/cs.po b/po/cs.po index 68a7b551a..0df5fadec 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -5281,6 +5281,10 @@ msgstr "%s: přidána notifikace pro %s%s" msgid "%s%s: notification not found" msgstr "%s%s: notifikace nenalezena" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "%s%s: \"%s\" příkaz může být spuštěn pouze v bufferu kanálu" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s%s: nemohu vytvořít nový soukromý buffer\"%s\"" diff --git a/po/de.po b/po/de.po index c3d8af674..c9b2e9a1c 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-06-30 21:30+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German <>\n" @@ -6231,6 +6231,10 @@ msgstr "%s: Benachrichtigung für %s%s%s gelöscht" msgid "%s%s: notification not found" msgstr "%s%s: Benachrichtigung nicht gefunden" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "%s%s: Der Befehl \"%s\" kann nur im Channel-Buffer ausgeführt werden" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s%s: ein neuer privater Buffer \"%s\" kann nicht erstellt werden" diff --git a/po/es.po b/po/es.po index 9a077f2a9..e6e144c5f 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -5507,6 +5507,10 @@ msgstr "%s: notificación para %s%s agregada" msgid "%s%s: notification not found" msgstr "%s%s: notificación no encontrada" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "%s%s: el comando \"%s\" solo puede ser ejecutado en un canal" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s%s: no es posible crear la conversación privada \"%s\"" diff --git a/po/fr.po b/po/fr.po index c792f9bbf..c43049637 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: 2015-06-30 07:49+0200\n" -"PO-Revision-Date: 2015-06-30 07:50+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" +"PO-Revision-Date: 2015-07-09 20:34+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -6095,6 +6095,12 @@ msgstr "%s : notification supprimée pour %s%s%s" msgid "%s%s: notification not found" msgstr "%s%s : notification non trouvée" +#, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "" +"%s%s : la commande \"%s\" ne peut pas être exécutée avec un nom de canal " +"(\"%s\")" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s%s : impossible de créer le tampon privé \"%s\"" diff --git a/po/hu.po b/po/hu.po index f4d40ae4c..5ababa56e 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4846,6 +4846,10 @@ msgstr "%s IP-cím nem található\n" msgid "%s%s: notification not found" msgstr "aláírás nem található" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "%s \"%s\" parancs csak a szobaablakban futtatható\n" + #, fuzzy, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s nem sikerült új privát ablakot nyitni \"%s\"\n" diff --git a/po/it.po b/po/it.po index fe50ff8ac..c47d71abf 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -5657,6 +5657,11 @@ msgstr "%s: notifica aggiunta per %s%s" msgid "%s%s: notification not found" msgstr "%s%s: notifica non trovata" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "" +"%s%s: il comando \"%s\" può essere eseguito solamente sul buffer del canale" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s%s: impossibile creare il nuovo buffer privato \"%s\"" diff --git a/po/ja.po b/po/ja.po index fed0f87b1..ed682ffc4 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-06-21 22:54+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -5823,6 +5823,10 @@ msgstr "%s: %s%s%s の通知を削除" msgid "%s%s: notification not found" msgstr "%s%s: 通知が見つかりません" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "%s%s: \"%s\" コマンドはチャンネルバッファ内でのみ実行可能" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s%s: 新しいプライベートバッファ \"%s\" の作成に失敗" diff --git a/po/pl.po b/po/pl.po index dbd6e6abd..a09d110ac 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-05-09 14:00+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -5955,6 +5955,10 @@ msgstr "%s: powiadomienie usunięte dla %s%s%s" msgid "%s%s: notification not found" msgstr "%s%s: nie znaleziono powiadomienia" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "%s%s: komenda \"%s\" może być tylko wykonana w buforze kanału" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s%s: nie można utworzyć nowego bufora prywatnego \"%s\"" diff --git a/po/pt_BR.po b/po/pt_BR.po index 9f077604e..a1699b1b8 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -5436,6 +5436,10 @@ msgstr "%s: desconectado do cliente %s%s%s (%s.%s)" msgid "%s%s: notification not found" msgstr "" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "%s%s: não foi possível criar novo canal \"%s\"" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "" diff --git a/po/ru.po b/po/ru.po index 332641043..1b0104054 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -4881,6 +4881,10 @@ msgstr "%s IP адрес не найден\n" msgid "%s%s: notification not found" msgstr "подпись не найдена" +#, fuzzy, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "%s \"%s\" команда может быть выполнена только в буфере канала\n" + #, fuzzy, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "%s невозможно создать новый буфер привата \"%s\"\n" diff --git a/po/tr.po b/po/tr.po index 216c4be94..1bf7ce722 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2015-03-10 21:33+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -4431,6 +4431,10 @@ msgstr "" msgid "%s%s: notification not found" msgstr "" +#, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index eac02c5c3..ddfc99a44 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: 2015-06-30 07:49+0200\n" +"POT-Creation-Date: 2015-07-09 20:32+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -4423,6 +4423,10 @@ msgstr "" msgid "%s%s: notification not found" msgstr "" +#, c-format +msgid "%s%s: \"%s\" command can not be executed with a channel name (\"%s\")" +msgstr "" + #, c-format msgid "%s%s: cannot create new private buffer \"%s\"" msgstr "" diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index d55a9a3ae..3edb5433a 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -3866,6 +3866,18 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc, for (i = 0; i < num_nicks; i++) { + /* ensure the name is not a channel name */ + if (irc_channel_is_channel (ptr_server, nicks[i])) + { + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can not be executed with a " + "channel name (\"%s\")"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "query", + nicks[i]); + continue; + } + /* create private window if not already opened */ ptr_channel = irc_channel_search (ptr_server, nicks[i]); if (!ptr_channel)