1
Author: Geert & exg vim:ft=diff:
2
Description: Do not allow /ping by itself to ctcp ping a channel. (upstream svn r4640)
4
Index: irssi-0.8.12/docs/help/in/ping.in
5
===================================================================
6
--- irssi-0.8.12.orig/docs/help/in/ping.in
7
+++ irssi-0.8.12/docs/help/in/ping.in
12
-Sends CTCP PING to another IRC client. This is used
13
-to find out the speed of IRC network. When the PING
14
-reply comes in, irssi shows the interval time between
15
-sending the request and receiving the reply.
16
+Sends CTCP PING to another IRC client or to an IRC channel.
17
+This is used to find out the speed of IRC network. When
18
+the PING reply comes in, irssi shows the interval time
19
+between sending the request and receiving the reply.
23
Index: irssi-0.8.12/src/irc/core/irc-commands.c
24
===================================================================
25
--- irssi-0.8.12.orig/src/irc/core/irc-commands.c
26
+++ irssi-0.8.12/src/irc/core/irc-commands.c
27
@@ -504,7 +504,7 @@ static void cmd_whowas(const char *data,
28
cmd_params_free(free_arg);
31
-/* SYNTAX: PING <nicks> */
32
+/* SYNTAX: PING [<nick> | <channel> | *] */
33
static void cmd_ping(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
36
@@ -512,10 +512,9 @@ static void cmd_ping(const char *data, I
38
CMD_IRC_SERVER(server);
40
- if (*data == '\0' || strcmp(data, "*") == 0) {
41
- if (!IS_IRC_ITEM(item))
42
- cmd_return_error(CMDERR_NOT_JOINED);
44
+ if (*data == '\0') {
45
+ if (!IS_QUERY(item))
46
+ cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS);
47
data = window_item_get_target(item);