summaryrefslogtreecommitdiff
blob: 0fff52a5a1f49b8bcc1f8dabbc5ed12ba1b2639a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
r4640 | jilles | 2007-11-17 16:35:47 +0000 (Sat, 17 Nov 2007) | 4 lines

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

Index: trunk/src/fe-common/irc/fe-irc-commands.c
===================================================================
--- trunk/src/fe-common/irc/fe-irc-commands.c	(revision 4639)
+++ trunk/src/fe-common/irc/fe-irc-commands.c	(revision 4640)
@@ -298,7 +298,7 @@
 	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;
Index: trunk/src/irc/core/irc-commands.c
===================================================================
--- trunk/src/irc/core/irc-commands.c	(revision 4639)
+++ trunk/src/irc/core/irc-commands.c	(revision 4640)
@@ -504,7 +504,7 @@
 	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 @@
 
         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);
 	}
 
Index: trunk/docs/help/in/ping.in
===================================================================
--- trunk/docs/help/in/ping.in	(revision 4639)
+++ trunk/docs/help/in/ping.in	(revision 4640)
@@ -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
 
Index: trunk/docs/help/in/ver.in
===================================================================
--- trunk/docs/help/in/ver.in	(revision 4639)
+++ trunk/docs/help/in/ver.in	(revision 4640)
@@ -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