summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@irssi.org>2007-11-17 16:35:47 +0000
committerjilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-11-17 16:35:47 +0000
commit18f2a0fc67326311bf8e6abb73c9bf524565336d (patch)
treec334beae04fee1e98e95e3c9b4e61675def95c4a
parent5bf14bbbe58f4889f71da94e4f53eb9e6032c05e (diff)
downloadirssi-18f2a0fc67326311bf8e6abb73c9bf524565336d.zip
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
-rw-r--r--docs/help/in/ping.in8
-rw-r--r--docs/help/in/ver.in6
-rw-r--r--src/fe-common/irc/fe-irc-commands.c2
-rw-r--r--src/irc/core/irc-commands.c9
4 files changed, 12 insertions, 13 deletions
diff --git a/docs/help/in/ping.in b/docs/help/in/ping.in
index 4a71147b..b4ebe57b 100644
--- a/docs/help/in/ping.in
+++ b/docs/help/in/ping.in
@@ -1,10 +1,10 @@
@SYNTAX:ping@
-Sends CTCP PING to another IRC client. This is used
-to find out the speed of IRC network. When the PING
-reply comes in, irssi shows the interval time between
-sending the request and receiving the reply.
+Sends CTCP PING to another IRC client or to an IRC channel.
+This is used to find out the speed of IRC network. When
+the PING reply comes in, irssi shows the interval time
+between sending the request and receiving the reply.
See also: CTCP
diff --git a/docs/help/in/ver.in b/docs/help/in/ver.in
index 975fbf7a..db0ea5cf 100644
--- a/docs/help/in/ver.in
+++ b/docs/help/in/ver.in
@@ -1,9 +1,9 @@
@SYNTAX:ver@
-Sends a CTCP VERSION request to the nick. This is used
-to find out which client and/or script the nick
-is using.
+Sends a CTCP VERSION request to a nick or channel.
+This is used to find out which client and/or
+script the nick is using.
See also: CTCP
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index 9172c677..37f8b9ab 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -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;
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c
index 7f31b59d..7255ad7e 100644
--- a/src/irc/core/irc-commands.c
+++ b/src/irc/core/irc-commands.c
@@ -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);
}