1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 19:43:14 +02:00

Added cmd_kick() function to IRCDProtoNew class.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1220 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-09-30 18:45:11 +00:00
parent d3a79969c2
commit ac05ac3857
13 changed files with 33 additions and 77 deletions
-1
View File
@@ -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));
+1 -1
View File
@@ -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_ {
+8 -16
View File
@@ -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))
{
+3 -7
View File
@@ -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);
+1 -1
View File
@@ -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;
+5 -16
View File
@@ -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);
+1 -1
View File
@@ -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;
+3 -7
View File
@@ -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);
+1 -1
View File
@@ -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;
+5 -16
View File
@@ -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);
+1 -1
View File
@@ -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;
+3 -8
View File
@@ -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);
+1 -1
View File
@@ -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;