diff options
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | include/services.h | 2 | ||||
-rw-r--r-- | src/ircd.c | 24 | ||||
-rw-r--r-- | src/protocol/bahamut.c | 10 | ||||
-rw-r--r-- | src/protocol/bahamut.h | 2 | ||||
-rw-r--r-- | src/protocol/charybdis.c | 21 | ||||
-rw-r--r-- | src/protocol/charybdis.h | 2 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 10 | ||||
-rwxr-xr-x | src/protocol/inspircd11.h | 2 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 21 | ||||
-rw-r--r-- | src/protocol/ratbox.h | 2 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 11 | ||||
-rw-r--r-- | src/protocol/unreal32.h | 2 |
13 files changed, 33 insertions, 77 deletions
diff --git a/include/extern.h b/include/extern.h index fd76bfd57..6867f2667 100644 --- a/include/extern.h +++ b/include/extern.h @@ -613,7 +613,6 @@ E void pmodule_cmd_372(void (*func) (const char *source, const char *msg)); E void pmodule_cmd_372_error(void (*func) (const char *source)); E void pmodule_cmd_375(void (*func) (const char *source)); E void pmodule_cmd_376(void (*func) (const char *source)); -E void pmodule_cmd_kick(void (*func) (const char *source, const char *chan, const char *user, const char *buf)); E void pmodule_cmd_notice_ops(void (*func) (const char *source, const char *dest, const char *buf)); E void pmodule_cmd_notice(void (*func) (const char *source, const char *dest, const char *buf)); E void pmodule_cmd_notice2(void (*func) (const char *source, const char *dest, const char *msg)); diff --git a/include/services.h b/include/services.h index 9fb548bd7..1f4d7f0ca 100644 --- a/include/services.h +++ b/include/services.h @@ -1079,7 +1079,6 @@ typedef struct ircd_proto_ { void (*ircd_cmd_372_error)(const char *source); void (*ircd_cmd_375)(const char *source); void (*ircd_cmd_376)(const char *source); - void (*ircd_cmd_kick)(const char *source, const char *chan, const char *user, const char *buf); void (*ircd_cmd_notice_ops)(const char *source, const char *dest, const char *buf); void (*ircd_cmd_notice)(const char *source, const char *dest, const char *buf); void (*ircd_cmd_notice2)(const char *source, const char *dest, const char *msg); @@ -1151,6 +1150,7 @@ class IRCDProtoNew { virtual void cmd_guest_nick(const char *, const char *, const char *, const char *, const char *) { } virtual void cmd_mode(const char *source, const char *dest, const char *buf) = 0; virtual void cmd_bot_nick(const char *, const char *, const char *, const char *, const char *) = 0; + virtual void cmd_kick(const char *source, const char *chan, const char *user, const char *buf) = 0; }; typedef struct ircd_modes_ { diff --git a/src/ircd.c b/src/ircd.c index 771c9a194..14bdd79e2 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -50,7 +50,6 @@ void initIrcdProto() ircdproto.ircd_cmd_372_error = NULL; ircdproto.ircd_cmd_375 = NULL; ircdproto.ircd_cmd_376 = NULL; - ircdproto.ircd_cmd_kick = NULL; ircdproto.ircd_cmd_notice_ops = NULL; ircdproto.ircd_cmd_notice = NULL; ircdproto.ircd_cmd_notice2 = NULL; @@ -215,15 +214,14 @@ void anope_cmd_bot_nick(const char *nick, const char *user, const char *host, co void anope_cmd_kick(const char *source, const char *chan, const char *user, const char *fmt, ...) { - va_list args; - char buf[BUFSIZE]; - *buf = '\0'; - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - ircdproto.ircd_cmd_kick(source, chan, user, buf); + va_list args; + char buf[BUFSIZE] = ""; + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + ircdprotonew->cmd_kick(source, chan, user, buf); } void anope_cmd_notice_ops(const char *source, const char *dest, const char *fmt, ...) @@ -697,12 +695,6 @@ void pmodule_cmd_376(void (*func) (const char *source)) ircdproto.ircd_cmd_376 = func; } -void pmodule_cmd_kick(void (*func) - (const char *source, const char *chan, const char *user, const char *buf)) -{ - ircdproto.ircd_cmd_kick = func; -} - void pmodule_cmd_notice_ops(void (*func) (const char *source, const char *dest, const char *buf)) { diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 6aa5619f2..1d0a8ac90 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -1207,13 +1207,10 @@ void BahamutIRCdProto::cmd_nick(const char *nick, const char *name, const char * bahamut_cmd_sqline(nick, "Reserved for services"); } -void bahamut_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) +void BahamutIRCdProto::cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { - if (buf) { - send_cmd(source, "KICK %s %s :%s", chan, user, buf); - } else { - send_cmd(source, "KICK %s %s", chan, user); - } + if (buf) send_cmd(source, "KICK %s %s :%s", chan, user, buf); + else send_cmd(source, "KICK %s %s", chan, user); } void bahamut_cmd_372(const char *source, const char *msg) @@ -1530,7 +1527,6 @@ void moduleAddAnopeCmds() pmodule_cmd_372_error(bahamut_cmd_372_error); pmodule_cmd_375(bahamut_cmd_375); pmodule_cmd_376(bahamut_cmd_376); - pmodule_cmd_kick(bahamut_cmd_kick); pmodule_cmd_notice_ops(bahamut_cmd_notice_ops); pmodule_cmd_notice(bahamut_cmd_notice); pmodule_cmd_notice2(bahamut_cmd_notice2); diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index f763b0bb3..7bc7b917e 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -63,7 +63,6 @@ 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); void bahamut_cmd_376(const char *source); -void bahamut_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); void bahamut_cmd_notice_ops(const char *source, const char *dest, const char *buf); void bahamut_cmd_notice(const char *source, const char *dest, const char *buf); void bahamut_cmd_notice2(const char *source, const char *dest, const char *msg); @@ -128,4 +127,5 @@ class BahamutIRCdProto : public IRCDProtoNew { void cmd_guest_nick(const char *, const char *, const char *, const char *, const char *); void cmd_mode(const char *source, const char *dest, const char *buf); void cmd_bot_nick(const char *, const char *, const char *, const char *, const char *); + void cmd_kick(const char *source, const char *chan, const char *user, const char *buf); } ircd_proto; diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index f3419ef47..65ca6fd76 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -1354,22 +1354,12 @@ void CharybdisProto::cmd_nick(const char *nick, const char *name, const char *mo charybdis_cmd_sqline(nick, "Reserved for services"); } -void charybdis_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) +void CharybdisProto::cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { - Uid *ud; - User *u; - - ud = find_uid(source); - u = finduser(user); - - if (buf) { - send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), - "KICK %s %s :%s", chan, - (UseTS6 ? (u ? u->uid : user) : user), buf); - } else { - send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "KICK %s %s", - chan, (UseTS6 ? (u ? u->uid : user) : user)); - } + Uid *ud = find_uid(source); + User *u = finduser(user); + if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KICK %s %s :%s", chan, UseTS6 ? (u ? u->uid : user) : user, buf); + else send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KICK %s %s", chan, UseTS6 ? (u ? u->uid : user) : user); } void charybdis_cmd_notice_ops(const char *source, const char *dest, const char *buf) @@ -1790,7 +1780,6 @@ void moduleAddAnopeCmds() pmodule_cmd_372_error(charybdis_cmd_372_error); pmodule_cmd_375(charybdis_cmd_375); pmodule_cmd_376(charybdis_cmd_376); - pmodule_cmd_kick(charybdis_cmd_kick); pmodule_cmd_notice_ops(charybdis_cmd_notice_ops); pmodule_cmd_notice(charybdis_cmd_notice); pmodule_cmd_notice2(charybdis_cmd_notice2); diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h index ab5a57c74..c7d697613 100644 --- a/src/protocol/charybdis.h +++ b/src/protocol/charybdis.h @@ -51,7 +51,6 @@ 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); void charybdis_cmd_376(const char *source); -void charybdis_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); void charybdis_cmd_notice_ops(const char *source, const char *dest, const char *buf); void charybdis_cmd_notice(const char *source, const char *dest, const char *buf); void charybdis_cmd_notice2(const char *source, const char *dest, const char *msg); @@ -115,4 +114,5 @@ class CharybdisProto : public IRCDProtoNew { void cmd_nick(const char *, const char *, const char *); void cmd_mode(const char *source, const char *dest, const char *buf); void cmd_bot_nick(const char *, const char *, const char *, const char *, const char *); + void cmd_kick(const char *source, const char *chan, const char *user, const char *buf); } ircd_proto; diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 894e6d66d..8f9e3cdfa 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -767,13 +767,10 @@ void InspIRCdProto::cmd_bot_nick(const char *nick, const char *user, const char send_cmd(nick, "OPERTYPE Bot"); } -void inspircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) +void InspIRCdProto::cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { - if (buf) { - send_cmd(source, "KICK %s %s :%s", chan, user, buf); - } else { - send_cmd(source, "KICK %s %s :%s", chan, user, user); - } + if (buf) send_cmd(source, "KICK %s %s :%s", chan, user, buf); + else send_cmd(source, "KICK %s %s :%s", chan, user, user); } void inspircd_cmd_notice_ops(const char *source, const char *dest, const char *buf) @@ -1778,7 +1775,6 @@ void moduleAddAnopeCmds() pmodule_cmd_372_error(inspircd_cmd_372_error); pmodule_cmd_375(inspircd_cmd_375); pmodule_cmd_376(inspircd_cmd_376); - pmodule_cmd_kick(inspircd_cmd_kick); pmodule_cmd_notice_ops(inspircd_cmd_notice_ops); pmodule_cmd_notice(inspircd_cmd_notice); pmodule_cmd_notice2(inspircd_cmd_notice2); diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h index 733961626..753d78fea 100755 --- a/src/protocol/inspircd11.h +++ b/src/protocol/inspircd11.h @@ -56,7 +56,6 @@ 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); void inspircd_cmd_376(const char *source); -void inspircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); void inspircd_cmd_notice_ops(const char *source, const char *dest, const char *buf); void inspircd_cmd_notice(const char *source, const char *dest, const char *buf); void inspircd_cmd_notice2(const char *source, const char *dest, const char *msg); @@ -132,4 +131,5 @@ class InspIRCdProto : public IRCDProtoNew { void cmd_guest_nick(const char *, const char *, const char *, const char *, const char *); void cmd_mode(const char *source, const char *dest, const char *buf); void cmd_bot_nick(const char *, const char *, const char *, const char *, const char *); + void cmd_kick(const char *source, const char *chan, const char *user, const char *buf); } ircd_proto; diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index 404db2ad3..25f55072a 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -1287,22 +1287,12 @@ void RatboxProto::cmd_nick(const char *nick, const char *name, const char *mode) ratbox_cmd_sqline(nick, "Reserved for services"); } -void ratbox_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) +void RatboxProto::cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { - Uid *ud; - User *u; - - ud = find_uid(source); - u = finduser(user); - - if (buf) { - send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), - "KICK %s %s :%s", chan, - (UseTS6 ? (u ? u->uid : user) : user), buf); - } else { - send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "KICK %s %s", - chan, (UseTS6 ? (u ? u->uid : user) : user)); - } + Uid *ud = find_uid(source); + User *u = finduser(user); + if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KICK %s %s :%s", chan, UseTS6 ? (u ? u->uid : user) : user, buf); + else send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KICK %s %s", chan, UseTS6 ? (u ? u->uid : user) : user); } void ratbox_cmd_notice_ops(const char *source, const char *dest, const char *buf) @@ -1682,7 +1672,6 @@ void moduleAddAnopeCmds() pmodule_cmd_372_error(ratbox_cmd_372_error); pmodule_cmd_375(ratbox_cmd_375); pmodule_cmd_376(ratbox_cmd_376); - pmodule_cmd_kick(ratbox_cmd_kick); pmodule_cmd_notice_ops(ratbox_cmd_notice_ops); pmodule_cmd_notice(ratbox_cmd_notice); pmodule_cmd_notice2(ratbox_cmd_notice2); diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h index cc6a1a2b2..83acc05d9 100644 --- a/src/protocol/ratbox.h +++ b/src/protocol/ratbox.h @@ -50,7 +50,6 @@ 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); void ratbox_cmd_376(const char *source); -void ratbox_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); void ratbox_cmd_notice_ops(const char *source, const char *dest, const char *buf); void ratbox_cmd_notice(const char *source, const char *dest, const char *buf); void ratbox_cmd_notice2(const char *source, const char *dest, const char *msg); @@ -113,4 +112,5 @@ class RatboxProto : public IRCDProtoNew { void cmd_nick(const char *, const char *, const char *); void cmd_mode(const char *source, const char *dest, const char *buf); void cmd_bot_nick(const char *, const char *, const char *, const char *, const char *); + void cmd_kick(const char *source, const char *chan, const char *user, const char *buf); } ircd_proto; diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index e6b434a25..e11b41def 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -616,14 +616,10 @@ void UnrealIRCdProto::cmd_bot_nick(const char *nick, const char *user, const cha unreal_cmd_sqline(nick, "Reserved for services"); } -void unreal_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) +void UnrealIRCdProto::cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { - if (buf) { - send_cmd(source, "%s %s %s :%s", send_token("KICK", "H"), chan, - user, buf); - } else { - send_cmd(source, "%s %s %s", send_token("KICK", "H"), chan, user); - } + if (buf) send_cmd(source, "%s %s %s :%s", send_token("KICK", "H"), chan, user, buf); + else send_cmd(source, "%s %s %s", send_token("KICK", "H"), chan, user); } void unreal_cmd_notice_ops(const char *source, const char *dest, const char *buf) @@ -2080,7 +2076,6 @@ void moduleAddAnopeCmds() pmodule_cmd_372_error(unreal_cmd_372_error); pmodule_cmd_375(unreal_cmd_375); pmodule_cmd_376(unreal_cmd_376); - pmodule_cmd_kick(unreal_cmd_kick); pmodule_cmd_notice_ops(unreal_cmd_notice_ops); pmodule_cmd_notice(unreal_cmd_notice); pmodule_cmd_notice2(unreal_cmd_notice2); diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h index fa7c4bff7..6e9c041b6 100644 --- a/src/protocol/unreal32.h +++ b/src/protocol/unreal32.h @@ -85,7 +85,6 @@ 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); void unreal_cmd_376(const char *source); -void unreal_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); void unreal_cmd_notice_ops(const char *source, const char *dest, const char *buf); void unreal_cmd_notice(const char *source, const char *dest, const char *buf); void unreal_cmd_notice2(const char *source, const char *dest, const char *msg); @@ -151,4 +150,5 @@ class UnrealIRCdProto : public IRCDProtoNew { void cmd_guest_nick(const char *, const char *, const char *, const char *, const char *); void cmd_mode(const char *source, const char *dest, const char *buf); void cmd_bot_nick(const char *, const char *, const char *, const char *, const char *); + void cmd_kick(const char *source, const char *chan, const char *user, const char *buf); } ircd_proto; |