Do not allow /ping by itself to ctcp ping a channel.

This is like the new /ver behaviour.
Bug #542, patch by Geert with tweaks by exg


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4640 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Jilles Tjoelker 2007-11-17 16:35:47 +00:00 committed by jilles
commit 18f2a0fc67
4 changed files with 12 additions and 13 deletions

View file

@ -298,7 +298,7 @@ static void cmd_ban(const char *data, IRC_SERVER_REC *server,
cmd_params_free(free_arg);
}
/* SYNTAX: VER [<target>] */
/* SYNTAX: VER [<nick> | <channel> | *] */
static void cmd_ver(gchar *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
{
char *str;

View file

@ -504,7 +504,7 @@ static void cmd_whowas(const char *data, IRC_SERVER_REC *server)
cmd_params_free(free_arg);
}
/* SYNTAX: PING <nicks> */
/* SYNTAX: PING [<nick> | <channel> | *] */
static void cmd_ping(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
{
GTimeVal tv;
@ -512,10 +512,9 @@ static void cmd_ping(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item
CMD_IRC_SERVER(server);
if (*data == '\0' || strcmp(data, "*") == 0) {
if (!IS_IRC_ITEM(item))
cmd_return_error(CMDERR_NOT_JOINED);
if (*data == '\0') {
if (!IS_QUERY(item))
cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS);
data = window_item_get_target(item);
}