2 # Parent 0047cf1b37551d1bfca8ffde6c6c98a7fcbc9a5f
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
8 int mo_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
11 + char *target=parv[1];
13 if (MyConnect(sptr) && parc > 1)
15 - if (!(acptr = find_match_server(parv[1])))
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());
25 + if (!(acptr = find_match_server(target))) {
26 + send_reply(sptr, ERR_NOSUCHSERVER, target);
29 - parv[1] = cli_name(acptr);
30 + target = cli_name(acptr);
33 if (hunt_server_cmd(sptr, CMD_VERSION, cptr, feature_int(FEAT_HIS_REMOTE),
35 int ms_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
38 + char *target=parv[1];
40 if (MyConnect(sptr) && parc > 1)
42 - if (!(acptr = find_match_server(parv[1])))
43 + if (!(acptr = find_match_server(target)))
45 - send_reply(sptr, ERR_NOSUCHSERVER, parv[1]);
46 + send_reply(sptr, ERR_NOSUCHSERVER, target);
49 - parv[1] = cli_name(acptr);
50 + target = cli_name(acptr);
53 + /* Version request with parameter *, send my version info and pass on the request */
54 + if (target[0] == '*' && target[1] == '\0')
56 + sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
57 + send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
58 + debug_serveropts());
61 if (hunt_server_cmd(sptr, CMD_VERSION, cptr, 0, ":%C", 1, parc, parv) ==