]>
Commit | Line | Data |
---|---|---|
1 | # HG changeset patch | |
2 | # Parent 0047cf1b37551d1bfca8ffde6c6c98a7fcbc9a5f | |
3 | ||
4 | diff -r 0047cf1b3755 ircd/m_version.c | |
5 | --- a/ircd/m_version.c Sun Jul 14 18:31:06 2013 +0100 | |
6 | +++ b/ircd/m_version.c Sun Jul 14 18:32:01 2013 +0100 | |
7 | @@ -127,15 +127,22 @@ | |
8 | int mo_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
9 | { | |
10 | struct Client *acptr; | |
11 | + char *target=parv[1]; | |
12 | ||
13 | if (MyConnect(sptr) && parc > 1) | |
14 | { | |
15 | - if (!(acptr = find_match_server(parv[1]))) | |
16 | - { | |
17 | - send_reply(sptr, ERR_NOSUCHSERVER, parv[1]); | |
18 | + /* Send version request to all servers when * is given as parameter */ | |
19 | + if (target[0] == '*' && target[1] == '\0') { | |
20 | + sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target); | |
21 | + send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me), | |
22 | + debug_serveropts()); | |
23 | + return 0; | |
24 | + } | |
25 | + if (!(acptr = find_match_server(target))) { | |
26 | + send_reply(sptr, ERR_NOSUCHSERVER, target); | |
27 | return 0; | |
28 | } | |
29 | - parv[1] = cli_name(acptr); | |
30 | + target = cli_name(acptr); | |
31 | } | |
32 | ||
33 | if (hunt_server_cmd(sptr, CMD_VERSION, cptr, feature_int(FEAT_HIS_REMOTE), | |
34 | @@ -160,17 +167,26 @@ | |
35 | int ms_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
36 | { | |
37 | struct Client *acptr; | |
38 | + char *target=parv[1]; | |
39 | ||
40 | if (MyConnect(sptr) && parc > 1) | |
41 | { | |
42 | - if (!(acptr = find_match_server(parv[1]))) | |
43 | + if (!(acptr = find_match_server(target))) | |
44 | { | |
45 | - send_reply(sptr, ERR_NOSUCHSERVER, parv[1]); | |
46 | + send_reply(sptr, ERR_NOSUCHSERVER, target); | |
47 | return 0; | |
48 | } | |
49 | - parv[1] = cli_name(acptr); | |
50 | + target = cli_name(acptr); | |
51 | } | |
52 | ||
53 | + /* Version request with parameter *, send my version info and pass on the request */ | |
54 | + if (target[0] == '*' && target[1] == '\0') | |
55 | + { | |
56 | + sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target); | |
57 | + send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me), | |
58 | + debug_serveropts()); | |
59 | + return 0; | |
60 | + } | |
61 | if (hunt_server_cmd(sptr, CMD_VERSION, cptr, 0, ":%C", 1, parc, parv) == | |
62 | HUNTED_ISME) | |
63 | { |