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

Added cmd_mode() function to IRCDProtoNew class.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1218 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-09-30 18:45:11 +00:00
parent 7a167d97af
commit 00466f884c
13 changed files with 39 additions and 81 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_mode(void (*func) (const char *source, const char *dest, const char *buf));
E void pmodule_cmd_bot_nick(void (*func) (const char *nick, const char *user, const char *host, const char *real, const char *modes));
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));
+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_mode)(const char *source, const char *dest, const char *buf);
void (*ircd_cmd_bot_nick)(const char *nick, const char *user, const char *host, const char *real, const char *modes);
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);
@@ -1151,6 +1150,7 @@ class IRCDProtoNew {
virtual void cmd_svsmode(User *u, int ac, const char **av) = 0;
virtual void cmd_nick(const char *, const char *, const char *) = 0;
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;
};
typedef struct ircd_modes_ {
+8 -15
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_mode = NULL;
ircdproto.ircd_cmd_bot_nick = NULL;
ircdproto.ircd_cmd_kick = NULL;
ircdproto.ircd_cmd_notice_ops = NULL;
@@ -200,15 +199,14 @@ void anope_cmd_guest_nick(const char *nick, const char *user, const char *host,
void anope_cmd_mode(const char *source, const char *dest, 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_mode(source, dest, buf);
va_list args;
char buf[BUFSIZE] = "";
if (fmt) {
va_start(args, fmt);
vsnprintf(buf, BUFSIZE - 1, fmt, args);
va_end(args);
}
ircdprotonew->cmd_mode(source, dest, buf);
}
void anope_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes)
@@ -700,11 +698,6 @@ void pmodule_cmd_376(void (*func) (const char *source))
ircdproto.ircd_cmd_376 = func;
}
void pmodule_cmd_mode(void (*func) (const char *source, const char *dest, const char *buf))
{
ircdproto.ircd_cmd_mode = func;
}
void pmodule_cmd_bot_nick(void (*func)
(const char *nick, const char *user, const char *host, const char *real,
const char *modes))
+4 -15
View File
@@ -471,21 +471,11 @@ CUMode myCumodes[128] = {
void bahamut_cmd_mode(const char *source, const char *dest, const char *buf)
void BahamutIRCdProto::cmd_mode(const char *source, const char *dest, const char *buf)
{
if (!buf) {
return;
}
if (ircdcap->tsmode) {
if (uplink_capab & ircdcap->tsmode) {
send_cmd(source, "MODE %s 0 %s", dest, buf);
} else {
send_cmd(source, "MODE %s %s", dest, buf);
}
} else {
send_cmd(source, "MODE %s %s", dest, buf);
}
if (!buf) return;
if (ircdcap->tsmode && (uplink_capab & ircdcap->tsmode)) send_cmd(source, "MODE %s 0 %s", dest, buf);
else send_cmd(source, "MODE %s %s", dest, buf);
}
/* SVSHOLD - set */
@@ -1542,7 +1532,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_mode(bahamut_cmd_mode);
pmodule_cmd_bot_nick(bahamut_cmd_bot_nick);
pmodule_cmd_kick(bahamut_cmd_kick);
pmodule_cmd_notice_ops(bahamut_cmd_notice_ops);
+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_mode(const char *source, const char *dest, const char *buf);
void bahamut_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes);
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);
@@ -128,4 +127,5 @@ class BahamutIRCdProto : public IRCDProtoNew {
void cmd_svsmode(User *u, int ac, const char **av);
void cmd_nick(const char *, const char *, const char *);
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);
} ircd_proto;
+7 -14
View File
@@ -1320,20 +1320,14 @@ void charybdis_cmd_211(const char *buf)
send_cmd(NULL, "211 %s", buf);
}
void charybdis_cmd_mode(const char *source, const char *dest, const char *buf)
void CharybdisProto::cmd_mode(const char *source, const char *dest, const char *buf)
{
Uid *ud;
if (!buf) {
return;
}
if (source) {
ud = find_uid(source);
send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "MODE %s %s",
dest, buf);
} else {
send_cmd(source, "MODE %s %s", dest, buf);
}
if (!buf) return;
if (source) {
Uid *ud = find_uid(source);
send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "MODE %s %s", dest, buf);
}
else send_cmd(source, "MODE %s %s", dest, buf);
}
void charybdis_cmd_tmode(const char *source, const char *dest, const char *fmt, ...)
@@ -1802,7 +1796,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_mode(charybdis_cmd_mode);
pmodule_cmd_bot_nick(charybdis_cmd_bot_nick);
pmodule_cmd_kick(charybdis_cmd_kick);
pmodule_cmd_notice_ops(charybdis_cmd_notice_ops);
+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_mode(const char *source, const char *dest, const char *buf);
void charybdis_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes);
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);
@@ -115,4 +114,5 @@ class CharybdisProto : public IRCDProtoNew {
void cmd_svskill(const char *source, const char *user, const char *buf);
void cmd_svsmode(User *u, int ac, const char **av);
void cmd_nick(const char *, const char *, const char *);
void cmd_mode(const char *source, const char *dest, const char *buf);
} ircd_proto;
+4 -9
View File
@@ -615,15 +615,11 @@ void InspIRCdProto::cmd_guest_nick(const char *nick, const char *user, const cha
send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s", static_cast<long>(time(NULL)), nick, host, host, user, modes, real);
}
void inspircd_cmd_mode(const char *source, const char *dest, const char *buf)
void InspIRCdProto::cmd_mode(const char *source, const char *dest, const char *buf)
{
Channel *c;
if (!buf) {
return;
}
c = findchan(dest);
send_cmd(source ? source : s_OperServ, "FMODE %s %u %s", dest, (unsigned int)((c) ? c->creation_time : time(NULL)), buf);
if (!buf) return;
Channel *c = findchan(dest);
send_cmd(source ? source : s_OperServ, "FMODE %s %u %s", dest, static_cast<unsigned>(c ? c->creation_time : time(NULL)), buf);
}
int anope_event_version(const char *source, int ac, const char **av)
@@ -1785,7 +1781,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_mode(inspircd_cmd_mode);
pmodule_cmd_bot_nick(inspircd_cmd_bot_nick);
pmodule_cmd_kick(inspircd_cmd_kick);
pmodule_cmd_notice_ops(inspircd_cmd_notice_ops);
+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_mode(const char *source, const char *dest, const char *buf);
void inspircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes);
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);
@@ -132,4 +131,5 @@ class InspIRCdProto : public IRCDProtoNew {
void cmd_svsmode(User *u, int ac, const char **av);
void cmd_nick(const char *, const char *, const char *);
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);
} ircd_proto;
+7 -14
View File
@@ -1253,20 +1253,14 @@ void ratbox_cmd_211(const char *buf)
send_cmd(NULL, "211 %s", buf);
}
void ratbox_cmd_mode(const char *source, const char *dest, const char *buf)
void RatboxProto::cmd_mode(const char *source, const char *dest, const char *buf)
{
Uid *ud;
if (!buf) {
return;
}
if (source) {
ud = find_uid(source);
send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "MODE %s %s",
dest, buf);
} else {
send_cmd(source, "MODE %s %s", dest, buf);
}
if (!buf) return;
if (source) {
Uid *ud = find_uid(source);
send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "MODE %s %s", dest, buf);
}
else send_cmd(source, "MODE %s %s", dest, buf);
}
void ratbox_cmd_tmode(const char *source, const char *dest, const char *fmt, ...)
@@ -1694,7 +1688,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_mode(ratbox_cmd_mode);
pmodule_cmd_bot_nick(ratbox_cmd_bot_nick);
pmodule_cmd_kick(ratbox_cmd_kick);
pmodule_cmd_notice_ops(ratbox_cmd_notice_ops);
+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_mode(const char *source, const char *dest, const char *buf);
void ratbox_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes);
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);
@@ -113,4 +112,5 @@ class RatboxProto : public IRCDProtoNew {
void cmd_svskill(const char *source, const char *user, const char *buf);
void cmd_svsmode(User *u, int ac, const char **av);
void cmd_nick(const char *, const char *, const char *);
void cmd_mode(const char *source, const char *dest, const char *buf);
} ircd_proto;
+3 -7
View File
@@ -602,13 +602,10 @@ void UnrealIRCdProto::cmd_guest_nick(const char *nick, const char *user, const c
myIrcd->nickip ? " *" : " ", real);
}
void unreal_cmd_mode(const char *source, const char *dest, const char *buf)
void UnrealIRCdProto::cmd_mode(const char *source, const char *dest, const char *buf)
{
if (!buf) {
return;
}
send_cmd(source, "%s %s %s", send_token("MODE", "G"), dest, buf);
if (!buf) return;
send_cmd(source, "%s %s %s", send_token("MODE", "G"), dest, buf);
}
void unreal_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real,
@@ -2086,7 +2083,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_mode(unreal_cmd_mode);
pmodule_cmd_bot_nick(unreal_cmd_bot_nick);
pmodule_cmd_kick(unreal_cmd_kick);
pmodule_cmd_notice_ops(unreal_cmd_notice_ops);
+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_mode(const char *source, const char *dest, const char *buf);
void unreal_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes);
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);
@@ -151,4 +150,5 @@ class UnrealIRCdProto : public IRCDProtoNew {
void cmd_svsmode(User *u, int ac, const char **av);
void cmd_nick(const char *, const char *, const char *);
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);
} ircd_proto;