diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:10 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:10 +0000 |
commit | 24ae706b9cbeef0efc697c15df3fec3828e2bdc1 (patch) | |
tree | 5937dbb9ed5b7b70c213891ae80a41833f337731 /src | |
parent | 3d4bf6d876f2ad537506cc2e3d0ef5d7051762e6 (diff) |
Added cmd_svsmode() function to IRCDProtoNew class.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1214 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/ircd.c | 10 | ||||
-rw-r--r-- | src/protocol/bahamut.c | 7 | ||||
-rw-r--r-- | src/protocol/bahamut.h | 2 | ||||
-rw-r--r-- | src/protocol/charybdis.c | 6 | ||||
-rw-r--r-- | src/protocol/charybdis.h | 2 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 12 | ||||
-rwxr-xr-x | src/protocol/inspircd11.h | 2 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 6 | ||||
-rw-r--r-- | src/protocol/ratbox.h | 2 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 22 | ||||
-rw-r--r-- | src/protocol/unreal32.h | 2 |
11 files changed, 24 insertions, 49 deletions
diff --git a/src/ircd.c b/src/ircd.c index dc7b0d02e..a243c9ca0 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -47,7 +47,6 @@ void initIrcdProto() ircdproto.ircd_set_mod_current_buffer = NULL; ircdproto.ircd_set_umode = NULL; ircdproto.ircd_cmd_svskill = NULL; - ircdproto.ircd_cmd_svsmode = NULL; ircdproto.ircd_cmd_372 = NULL; ircdproto.ircd_cmd_372_error = NULL; ircdproto.ircd_cmd_375 = NULL; @@ -168,9 +167,9 @@ void anope_cmd_svskill(const char *source, const char *user, const char *fmt, .. ircdproto.ircd_cmd_svskill(source, user, buf); } -void anope_cmd_svsmode(User * u, int ac, const char **av) +void anope_cmd_svsmode(User *u, int ac, const char **av) { - ircdproto.ircd_cmd_svsmode(u, ac, av); + ircdprotonew->cmd_svsmode(u, ac, av); } void anope_cmd_372(const char *source, const char *msg) @@ -691,11 +690,6 @@ pmodule_cmd_svskill(void (*func) (const char *source, const char *user, const ch ircdproto.ircd_cmd_svskill = func; } -void pmodule_cmd_svsmode(void (*func) (User * u, int ac, const char **av)) -{ - ircdproto.ircd_cmd_svsmode = func; -} - void pmodule_cmd_372(void (*func) (const char *source, const char *msg)) { ircdproto.ircd_cmd_372 = func; diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 5987cd9f0..0443f8250 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -828,11 +828,9 @@ void BahamutIRCdProto::cmd_svskill(const char *source, const char *user, const c * parv[3] - mode (or services id if old svs version) * parv[4] - optional arguement (services id) */ -void bahamut_cmd_svsmode(User * u, int ac, const char **av) +void BahamutIRCdProto::cmd_svsmode(User *u, int ac, const char **av) { - send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick, - (long int) u->timestamp, av[0], (ac == 2 ? " " : ""), - (ac == 2 ? av[1] : "")); + send_cmd(ServerName, "SVSMODE %s %ld %s", u->nick, static_cast<long>(u->timestamp), merge_args(ac, av)); } /* SQUIT */ @@ -1544,7 +1542,6 @@ void bahamut_cmd_chghost(const char *nick, const char *vhost) **/ void moduleAddAnopeCmds() { - pmodule_cmd_svsmode(bahamut_cmd_svsmode); pmodule_cmd_372(bahamut_cmd_372); pmodule_cmd_372_error(bahamut_cmd_372_error); pmodule_cmd_375(bahamut_cmd_375); diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index 1db0b577f..8a03d8642 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -59,7 +59,6 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r void bahamut_set_umode(User * user, int ac, const char **av); -void bahamut_cmd_svsmode(User * u, int ac, const char **av); void bahamut_cmd_372(const char *source, const char *msg); void bahamut_cmd_372_error(const char *source); void bahamut_cmd_375(const char *source); @@ -128,4 +127,5 @@ class BahamutIRCdProto : public IRCDProtoNew { void cmd_topic(const char *, const char *, const char *, const char *, time_t); void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *); void cmd_svskill(const char *source, const char *user, const char *buf); + void cmd_svsmode(User *u, int ac, const char **av); } ircd_proto; diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 0fb878226..0dfcce2e2 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -890,10 +890,9 @@ void CharybdisProto::cmd_svskill(const char *source, const char *user, const cha send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KILL %s :%s", UseTS6 ? (ud2 ? ud2->uid : user) : user, buf); } -void charybdis_cmd_svsmode(User * u, int ac, const char **av) +void CharybdisProto::cmd_svsmode(User *u, int ac, const char **av) { - send_cmd((UseTS6 ? TS6SID : ServerName), "SVSMODE %s %s", u->nick, - av[0]); + send_cmd(UseTS6 ? TS6SID : ServerName, "SVSMODE %s %s", u->nick, av[0]); } /* @@ -1810,7 +1809,6 @@ int charybdis_send_deaccount(int argc, char **argv) **/ void moduleAddAnopeCmds() { - pmodule_cmd_svsmode(charybdis_cmd_svsmode); pmodule_cmd_372(charybdis_cmd_372); pmodule_cmd_372_error(charybdis_cmd_372_error); pmodule_cmd_375(charybdis_cmd_375); diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h index 6b65d3e1d..601bf4003 100644 --- a/src/protocol/charybdis.h +++ b/src/protocol/charybdis.h @@ -47,7 +47,6 @@ void charybdis_set_umode(User * user, int ac, const char **av); -void charybdis_cmd_svsmode(User * u, int ac, const char **av); void charybdis_cmd_372(const char *source, const char *msg); void charybdis_cmd_372_error(const char *source); void charybdis_cmd_375(const char *source); @@ -116,4 +115,5 @@ class CharybdisProto : public IRCDProtoNew { void cmd_vhost_off(User *); void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *); void cmd_svskill(const char *source, const char *user, const char *buf); + void cmd_svsmode(User *u, int ac, const char **av); } ircd_proto; diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index b21d8f365..383605282 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -571,13 +571,12 @@ void InspIRCdProto::cmd_svskill(const char *source, const char *user, const char send_cmd(source, "KILL %s :%s", user, buf); } -void inspircd_cmd_svsmode(User * u, int ac, const char **av) +void InspIRCdProto::cmd_svsmode(User *u, int ac, const char **av) { - /* This was originally done using this: - send_cmd(s_NickServ, "MODE %s %s%s%s", u->nick, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); - * but that's the dirty way of doing things... - */ - send_cmd(s_NickServ, "MODE %s %s", u->nick, merge_args(ac, av)); + /* This was originally done using this: + send_cmd(s_NickServ, "MODE %s %s%s%s", u->nick, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); + * but that's the dirty way of doing things... */ + send_cmd(s_NickServ, "MODE %s %s", u->nick, merge_args(ac, av)); } @@ -1787,7 +1786,6 @@ void inspircd_cmd_ctcp(const char *source, const char *dest, const char *buf) **/ void moduleAddAnopeCmds() { - pmodule_cmd_svsmode(inspircd_cmd_svsmode); pmodule_cmd_372(inspircd_cmd_372); pmodule_cmd_372_error(inspircd_cmd_372_error); pmodule_cmd_375(inspircd_cmd_375); diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h index a0ab419e6..997507f54 100755 --- a/src/protocol/inspircd11.h +++ b/src/protocol/inspircd11.h @@ -52,7 +52,6 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r void inspircd_set_umode(User * user, int ac, const char **av); -void inspircd_cmd_svsmode(User * u, int ac, const char **av); void inspircd_cmd_372(const char *source, const char *msg); void inspircd_cmd_372_error(const char *source); void inspircd_cmd_375(const char *source); @@ -132,4 +131,5 @@ class InspIRCdProto : public IRCDProtoNew { void cmd_vhost_off(User *); void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *); void cmd_svskill(const char *source, const char *user, const char *buf); + void cmd_svsmode(User *u, int ac, const char **av); } ircd_proto; diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index e0b3ebfc9..53fb8675d 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -832,10 +832,9 @@ void RatboxProto::cmd_svskill(const char *source, const char *user, const char * send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KILL %s :%s", UseTS6 ? (ud2 ? ud2->uid : user) : user, buf); } -void ratbox_cmd_svsmode(User * u, int ac, const char **av) +void RatboxProto::cmd_svsmode(User *u, int ac, const char **av) { - send_cmd((UseTS6 ? TS6SID : ServerName), "SVSMODE %s %s", u->nick, - av[0]); + send_cmd(UseTS6 ? TS6SID : ServerName, "SVSMODE %s %s", u->nick, av[0]); } /* @@ -1702,7 +1701,6 @@ void ratbox_cmd_ctcp(const char *source, const char *dest, const char *buf) **/ void moduleAddAnopeCmds() { - pmodule_cmd_svsmode(ratbox_cmd_svsmode); pmodule_cmd_372(ratbox_cmd_372); pmodule_cmd_372_error(ratbox_cmd_372_error); pmodule_cmd_375(ratbox_cmd_375); diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h index 68be52606..bbcb2b6c6 100644 --- a/src/protocol/ratbox.h +++ b/src/protocol/ratbox.h @@ -46,7 +46,6 @@ void ratbox_set_umode(User * user, int ac, const char **av); -void ratbox_cmd_svsmode(User * u, int ac, const char **av); void ratbox_cmd_372(const char *source, const char *msg); void ratbox_cmd_372_error(const char *source); void ratbox_cmd_375(const char *source); @@ -114,4 +113,5 @@ class RatboxProto : public IRCDProtoNew { void cmd_topic(const char *, const char *, const char *, const char *, time_t); void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *); void cmd_svskill(const char *source, const char *user, const char *buf); + void cmd_svsmode(User *u, int ac, const char **av); } ircd_proto; diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 9d64c423d..10c4e8738 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -556,22 +556,13 @@ void UnrealIRCdProto::cmd_svskill(const char *source, const char *user, const ch * parv[2] - modes to change * parv[3] - Service Stamp (if mode == d) */ -void unreal_cmd_svsmode(User * u, int ac, const char **av) +void UnrealIRCdProto::cmd_svsmode(User *u, int ac, const char **av) { - if (ac >= 1) { - if (!u || !av[0]) { - return; - } - if (UseSVS2MODE) { - send_cmd(ServerName, "%s %s %s%s%s", - send_token("SVS2MODE", "v"), u->nick, av[0], - (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); - } else { - send_cmd(ServerName, "%s %s %s%s%s", - send_token("SVSMODE", "n"), u->nick, av[0], - (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); - } - } + if (ac >= 1) { + if (!u || !av[0]) return; + if (UseSVS2MODE) send_cmd(ServerName, "%s %s %s", send_token("SVS2MODE", "v"), u->nick, merge_args(ac, av)); + else send_cmd(ServerName, "%s %s %s", send_token("SVSMODE", "n"), u->nick, merge_args(ac, av)); + } } /* 372 */ @@ -2096,7 +2087,6 @@ void moduleAddIRCDMsgs(void) { **/ void moduleAddAnopeCmds() { - pmodule_cmd_svsmode(unreal_cmd_svsmode); pmodule_cmd_372(unreal_cmd_372); pmodule_cmd_372_error(unreal_cmd_372_error); pmodule_cmd_375(unreal_cmd_375); diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h index 69b659d73..4d849d55f 100644 --- a/src/protocol/unreal32.h +++ b/src/protocol/unreal32.h @@ -81,7 +81,6 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r void unreal_set_umode(User * user, int ac, const char **av); -void unreal_cmd_svsmode(User * u, int ac, const char **av); void unreal_cmd_372(const char *source, const char *msg); void unreal_cmd_372_error(const char *source); void unreal_cmd_375(const char *source); @@ -151,4 +150,5 @@ class UnrealIRCdProto : public IRCDProtoNew { void cmd_vhost_off(User *); void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *); void cmd_svskill(const char *source, const char *user, const char *buf); + void cmd_svsmode(User *u, int ac, const char **av); } ircd_proto; |