1 same as 42 but then for version, tidied up a bit, and use hunt_server_cmd to find and forward remote requests to, rather than doing that work itself in the various *_version functions.
3 diff -r 2fe969629892 ircd/m_version.c
4 --- a/ircd/m_version.c Sun Jan 11 22:38:40 2009 +0000
5 +++ b/ircd/m_version.c Sun Jan 11 22:38:40 2009 +0000
8 int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
10 - if (parc > 1 && match(parv[1], cli_name(&me)))
12 return send_reply(sptr, ERR_NOPRIVILEGES);
14 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
19 - if (MyConnect(sptr) && parc > 1)
21 - /* Send version request to all servers when * is given as parameter */
22 - if (target[0] == '*' && target[1] == '\0') {
23 - sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
24 - send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
25 - debug_serveropts());
28 - if (!(acptr = find_match_server(target))) {
29 - send_reply(sptr, ERR_NOSUCHSERVER, target);
32 - target = cli_name(acptr);
33 + /* Send version request to all servers when * is given as parameter */
34 + if (parc > 1 && target[0] == '*' && target[1] == '\0') {
35 + sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
36 + send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
37 + debug_serveropts());
41 if (hunt_server_cmd(sptr, CMD_VERSION, cptr, feature_int(FEAT_HIS_REMOTE),
45 + ":%C", 1, parc, parv) == HUNTED_ISME)
47 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
53 - if (MyConnect(sptr) && parc > 1)
55 - if (!(acptr = find_match_server(target)))
57 - send_reply(sptr, ERR_NOSUCHSERVER, target);
60 - target = cli_name(acptr);
63 /* Version request with parameter *, send my version info and pass on the request */
64 - if (target[0] == '*' && target[1] == '\0')
65 + if (parc > 1 && target[0] == '*' && target[1] == '\0')
67 sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
68 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),