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 6bd3926f94aa ircd/m_version.c
4 --- a/ircd/m_version.c Sat Jan 31 18:42:09 2009 +0100
5 +++ b/ircd/m_version.c Sat Jan 31 18:43:26 2009 +0100
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),
17 int mo_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
19 - struct Client *acptr;
22 - if (MyConnect(sptr) && parc > 1)
24 - /* Send version request to all servers when * is given as parameter */
25 - if (target[0] == '*' && target[1] == '\0') {
26 - sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
27 - send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
28 - debug_serveropts());
31 - if (!(acptr = find_match_server(target))) {
32 - send_reply(sptr, ERR_NOSUCHSERVER, target);
35 - target = cli_name(acptr);
36 + /* Send version request to all servers when * is given as parameter */
37 + if (parc > 1 && target[0] == '*' && target[1] == '\0') {
38 + sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
39 + send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
40 + debug_serveropts());
44 if (hunt_server_cmd(sptr, CMD_VERSION, cptr, feature_int(FEAT_HIS_REMOTE),
48 + ":%C", 1, parc, parv) == HUNTED_ISME)
50 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
54 int ms_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
56 - struct Client *acptr;
59 - if (MyConnect(sptr) && parc > 1)
61 - if (!(acptr = find_match_server(target)))
63 - send_reply(sptr, ERR_NOSUCHSERVER, target);
66 - target = cli_name(acptr);
69 /* Version request with parameter *, send my version info and pass on the request */
70 - if (target[0] == '*' && target[1] == '\0')
71 + if (parc > 1 && target[0] == '*' && target[1] == '\0')
73 sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
74 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),