]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blob - hisversionremote.patch
Add opernowildbadchan patch - disallows wildcards in badchan set by oper
[irc/quakenet/snircd-patchqueue.git] / hisversionremote.patch
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.
2
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
6 @@ -109,7 +109,7 @@
7 */
8 int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
9 {
10 - if (parc > 1 && match(parv[1], cli_name(&me)))
11 + if (parc > 1)
12 return send_reply(sptr, ERR_NOPRIVILEGES);
13
14 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
15 @@ -129,26 +129,16 @@
16 struct Client *acptr;
17 char *target=parv[1];
18
19 - if (MyConnect(sptr) && parc > 1)
20 - {
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());
26 - return 0;
27 - }
28 - if (!(acptr = find_match_server(target))) {
29 - send_reply(sptr, ERR_NOSUCHSERVER, target);
30 - return 0;
31 - }
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());
38 + return 0;
39 }
40
41 if (hunt_server_cmd(sptr, CMD_VERSION, cptr, feature_int(FEAT_HIS_REMOTE),
42 - ":%C", 1,
43 - parc, parv)
44 - == HUNTED_ISME)
45 + ":%C", 1, parc, parv) == HUNTED_ISME)
46 {
47 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
48 debug_serveropts());
49 @@ -169,18 +159,8 @@
50 struct Client *acptr;
51 char *target=parv[1];
52
53 - if (MyConnect(sptr) && parc > 1)
54 - {
55 - if (!(acptr = find_match_server(target)))
56 - {
57 - send_reply(sptr, ERR_NOSUCHSERVER, target);
58 - return 0;
59 - }
60 - target = cli_name(acptr);
61 - }
62 -
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')
66 {
67 sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
68 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),