]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blob - hisversionremote.patch
hisversionremote.patch removed unnused variable acptr from mo_version and ms_version
[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 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
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 @@ -126,29 +126,18 @@
16 */
17 int mo_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
18 {
19 - struct Client *acptr;
20 char *target=parv[1];
21
22 - if (MyConnect(sptr) && parc > 1)
23 - {
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());
29 - return 0;
30 - }
31 - if (!(acptr = find_match_server(target))) {
32 - send_reply(sptr, ERR_NOSUCHSERVER, target);
33 - return 0;
34 - }
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());
41 + return 0;
42 }
43
44 if (hunt_server_cmd(sptr, CMD_VERSION, cptr, feature_int(FEAT_HIS_REMOTE),
45 - ":%C", 1,
46 - parc, parv)
47 - == HUNTED_ISME)
48 + ":%C", 1, parc, parv) == HUNTED_ISME)
49 {
50 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
51 debug_serveropts());
52 @@ -166,21 +155,10 @@
53 */
54 int ms_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
55 {
56 - struct Client *acptr;
57 char *target=parv[1];
58
59 - if (MyConnect(sptr) && parc > 1)
60 - {
61 - if (!(acptr = find_match_server(target)))
62 - {
63 - send_reply(sptr, ERR_NOSUCHSERVER, target);
64 - return 0;
65 - }
66 - target = cli_name(acptr);
67 - }
68 -
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')
72 {
73 sendcmdto_serv_butone(sptr, CMD_VERSION, cptr, ":%s", target);
74 send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),