summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-command.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-07-09 20:35:27 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-07-09 20:35:27 +0200
commitcc774d099b16280775b86173541c43f54a38fa71 (patch)
treeeee89d873a15a003130e04179b3913cbd1542e64 /src/plugins/irc/irc-command.c
parentb2f0cc30ff37fb63698ff7f6ad0c0f1398632729 (diff)
downloadweechat-cc774d099b16280775b86173541c43f54a38fa71.zip
irc: do not allow command /query with a channel name (closes #459)
Diffstat (limited to 'src/plugins/irc/irc-command.c')
-rw-r--r--src/plugins/irc/irc-command.c12
1 files changed, 12 insertions, 0 deletions
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)