diff options
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | include/services.h | 6 | ||||
-rw-r--r-- | src/ircd.c | 23 | ||||
-rw-r--r-- | src/protocol/bahamut.c | 11 | ||||
-rw-r--r-- | src/protocol/bahamut.h | 1 | ||||
-rw-r--r-- | src/protocol/charybdis.c | 29 | ||||
-rw-r--r-- | src/protocol/charybdis.h | 2 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 11 | ||||
-rwxr-xr-x | src/protocol/inspircd11.h | 1 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 28 | ||||
-rw-r--r-- | src/protocol/ratbox.h | 2 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 12 | ||||
-rw-r--r-- | src/protocol/unreal32.h | 1 |
13 files changed, 36 insertions, 92 deletions
diff --git a/include/extern.h b/include/extern.h index a07d60996..b3330e66b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -623,7 +623,6 @@ E void pmodule_cmd_318(void (*func) (const char *source, const char *who)); E void pmodule_cmd_242(void (*func) (const char *buf)); E void pmodule_cmd_243(void (*func) (const char *buf)); E void pmodule_cmd_211(void (*func) (const char *buf)); -E void pmodule_cmd_global(void (*func) (const char *source, const char *buf)); E void pmodule_cmd_sqline(void (*func) (const char *mask, const char *reason)); E void pmodule_cmd_squit(void (*func) (const char *servname, const char *message)); E void pmodule_cmd_svso(void (*func) (const char *source, const char *nick, const char *flag)); diff --git a/include/services.h b/include/services.h index 1eff33566..f30b63828 100644 --- a/include/services.h +++ b/include/services.h @@ -1073,7 +1073,6 @@ typedef struct ircd_proto_ { void (*ircd_cmd_242)(const char *buf); void (*ircd_cmd_243)(const char *buf); void (*ircd_cmd_211)(const char *buf); - void (*ircd_cmd_global)(const char *source, const char *buf); void (*ircd_cmd_sqline)(const char *mask, const char *reason); void (*ircd_cmd_squit)(const char *servname, const char *message); void (*ircd_cmd_svso)(const char *source, const char *nick, const char *flag); @@ -1342,6 +1341,11 @@ class IRCDProtoNew { if (buf) send_cmd(nick, "PART %s :%s", chan, buf); else send_cmd(nick, "PART %s", chan); } + virtual void cmd_global(const char *source, const char *buf) + { + if (!buf) return; + send_cmd(source ? source : ServerName, "GLOBOPS :%s", buf); + } }; /*************************************************************************/ diff --git a/src/ircd.c b/src/ircd.c index c2ba87303..a09a19ea9 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -63,7 +63,6 @@ void initIrcdProto() ircdproto.ircd_cmd_242 = NULL; ircdproto.ircd_cmd_243 = NULL; ircdproto.ircd_cmd_211 = NULL; - ircdproto.ircd_cmd_global = NULL; ircdproto.ircd_cmd_sqline = NULL; ircdproto.ircd_cmd_squit = NULL; ircdproto.ircd_cmd_svso = NULL; @@ -458,15 +457,14 @@ void anope_cmd_211(const char *fmt, ...) void anope_cmd_global(const char *source, 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_global(source, buf); + va_list args; + char buf[BUFSIZE] = ""; + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + ircdprotonew->cmd_global(source, buf); } void anope_cmd_sqline(const char *mask, const char *reason) @@ -714,11 +712,6 @@ void pmodule_cmd_211(void (*func) (const char *buf)) ircdproto.ircd_cmd_211 = func; } -void pmodule_cmd_global(void (*func) (const char *source, const char *buf)) -{ - ircdproto.ircd_cmd_global = func; -} - void pmodule_cmd_sqline(void (*func) (const char *mask, const char *reason)) { ircdproto.ircd_cmd_sqline = func; diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index b1fdedf86..084b8f66f 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -1008,16 +1008,6 @@ void BahamutIRCdProto::cmd_notice_ops(const char *source, const char *dest, cons send_cmd(NULL, "NOTICE @%s :%s", dest, buf); } -/* GLOBOPS */ -void bahamut_cmd_global(const char *source, const char *buf) -{ - if (!buf) { - return; - } - - send_cmd(source ? source : ServerName, "GLOBOPS :%s", buf); -} - /* 391 */ void bahamut_cmd_391(const char *source, const char *timestr) { @@ -1461,7 +1451,6 @@ void moduleAddAnopeCmds() pmodule_cmd_242(bahamut_cmd_242); pmodule_cmd_243(bahamut_cmd_243); pmodule_cmd_211(bahamut_cmd_211); - pmodule_cmd_global(bahamut_cmd_global); pmodule_cmd_sqline(bahamut_cmd_sqline); pmodule_cmd_squit(bahamut_cmd_squit); pmodule_cmd_svso(bahamut_cmd_svso); diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index 6eaa5d8eb..2e7fabed4 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -76,7 +76,6 @@ void bahamut_cmd_318(const char *source, const char *who); void bahamut_cmd_242(const char *buf); void bahamut_cmd_243(const char *buf); void bahamut_cmd_211(const char *buf); -void bahamut_cmd_global(const char *source, const char *buf); void bahamut_cmd_sqline(const char *mask, const char *reason); void bahamut_cmd_squit(const char *servname, const char *message); void bahamut_cmd_svso(const char *source, const char *nick, const char *flag); diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 0e5c4c6ae..e2c04b4a1 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -473,24 +473,18 @@ void CharybdisProto::cmd_privmsg(const char *source, const char *dest, const cha send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "PRIVMSG %s :%s", UseTS6 ? (ud2 ? ud2->uid : dest) : dest, buf); } -void charybdis_cmd_global(const char *source, const char *buf) +void CharybdisProto::cmd_global(const char *source, const char *buf) { - Uid *u; - - if (!buf) { - return; - } - - if (source) { - u = find_uid(source); - if (u) { - send_cmd((UseTS6 ? u->uid : source), "OPERWALL :%s", buf); - } else { - send_cmd((UseTS6 ? TS6SID : ServerName), "WALLOPS :%s", buf); - } - } else { - send_cmd((UseTS6 ? TS6SID : ServerName), "WALLOPS :%s", buf); - } + if (!buf) return; + if (source) { + Uid *u = find_uid(source); + if (u) { + send_cmd(UseTS6 ? u->uid : source, "OPERWALL :%s", buf); + return; + } + } + // The original code uses WALLOPS here, but above is OPERWALL, Ratbox uses OPERWALL as well, so I changed this one as well -- CyberBotX + send_cmd(UseTS6 ? TS6SID : ServerName, "OPERWALL :%s", buf); } int anope_event_sjoin(const char *source, int ac, const char **av) @@ -1721,7 +1715,6 @@ void moduleAddAnopeCmds() pmodule_cmd_242(charybdis_cmd_242); pmodule_cmd_243(charybdis_cmd_243); pmodule_cmd_211(charybdis_cmd_211); - pmodule_cmd_global(charybdis_cmd_global); pmodule_cmd_sqline(charybdis_cmd_sqline); pmodule_cmd_squit(charybdis_cmd_squit); pmodule_cmd_svso(charybdis_cmd_svso); diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h index 752f1281b..80dec7aeb 100644 --- a/src/protocol/charybdis.h +++ b/src/protocol/charybdis.h @@ -64,7 +64,6 @@ void charybdis_cmd_318(const char *source, const char *who); void charybdis_cmd_242(const char *buf); void charybdis_cmd_243(const char *buf); void charybdis_cmd_211(const char *buf); -void charybdis_cmd_global(const char *source, const char *buf); void charybdis_cmd_sqline(const char *mask, const char *reason); void charybdis_cmd_squit(const char *servname, const char *message); void charybdis_cmd_svso(const char *source, const char *nick, const char *flag); @@ -113,4 +112,5 @@ class CharybdisProto : public IRCDProtoNew { void cmd_unsqline(const char *); void cmd_invite(const char *, const char *, const char *); void cmd_part(const char *, const char *, const char *); + void cmd_global(const char *, const char *); } ircd_proto; diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index e3c3ab7dd..3cee1c44e 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -961,16 +961,6 @@ void inspircd_cmd_211(const char *buf) send_cmd(NULL, "211 %s", buf); } -/* GLOBOPS */ -void inspircd_cmd_global(const char *source, const char *buf) -{ - if (!buf) { - return; - } - - send_cmd(source ? source : ServerName, "GLOBOPS :%s", buf); -} - /* SQLINE */ void inspircd_cmd_sqline(const char *mask, const char *reason) { @@ -1705,7 +1695,6 @@ void moduleAddAnopeCmds() pmodule_cmd_242(inspircd_cmd_242); pmodule_cmd_243(inspircd_cmd_243); pmodule_cmd_211(inspircd_cmd_211); - pmodule_cmd_global(inspircd_cmd_global); pmodule_cmd_sqline(inspircd_cmd_sqline); pmodule_cmd_squit(inspircd_cmd_squit); pmodule_cmd_svso(inspircd_cmd_svso); diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h index 11a9efabd..bb7472438 100755 --- a/src/protocol/inspircd11.h +++ b/src/protocol/inspircd11.h @@ -69,7 +69,6 @@ void inspircd_cmd_318(const char *source, const char *who); void inspircd_cmd_242(const char *buf); void inspircd_cmd_243(const char *buf); void inspircd_cmd_211(const char *buf); -void inspircd_cmd_global(const char *source, const char *buf); void inspircd_cmd_sqline(const char *mask, const char *reason); void inspircd_cmd_squit(const char *servname, const char *message); void inspircd_cmd_svso(const char *source, const char *nick, const char *flag); diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index 57ede49e3..98aa5bbdd 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -462,24 +462,17 @@ void RatboxProto::cmd_privmsg(const char *source, const char *dest, const char * send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "PRIVMSG %s :%s", UseTS6 ? (ud2 ? ud2->uid : dest) : dest, buf); } -void ratbox_cmd_global(const char *source, const char *buf) +void RatboxProto::cmd_global(const char *source, const char *buf) { - Uid *u; - - if (!buf) { - return; - } - - if (source) { - u = find_uid(source); - if (u) { - send_cmd((UseTS6 ? u->uid : source), "OPERWALL :%s", buf); - } else { - send_cmd((UseTS6 ? TS6SID : ServerName), "OPERWALL :%s", buf); - } - } else { - send_cmd((UseTS6 ? TS6SID : ServerName), "OPERWALL :%s", buf); - } + if (!buf) return; + if (source) { + Uid *u = find_uid(source); + if (u) { + send_cmd(UseTS6 ? u->uid : source, "OPERWALL :%s", buf); + return; + } + } + send_cmd(UseTS6 ? TS6SID : ServerName, "OPERWALL :%s", buf); } int anope_event_sjoin(const char *source, int ac, const char **av) @@ -1615,7 +1608,6 @@ void moduleAddAnopeCmds() pmodule_cmd_242(ratbox_cmd_242); pmodule_cmd_243(ratbox_cmd_243); pmodule_cmd_211(ratbox_cmd_211); - pmodule_cmd_global(ratbox_cmd_global); pmodule_cmd_sqline(ratbox_cmd_sqline); pmodule_cmd_squit(ratbox_cmd_squit); pmodule_cmd_svso(ratbox_cmd_svso); diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h index 698b3a7dc..b79a917ba 100644 --- a/src/protocol/ratbox.h +++ b/src/protocol/ratbox.h @@ -63,7 +63,6 @@ void ratbox_cmd_318(const char *source, const char *who); void ratbox_cmd_242(const char *buf); void ratbox_cmd_243(const char *buf); void ratbox_cmd_211(const char *buf); -void ratbox_cmd_global(const char *source, const char *buf); void ratbox_cmd_sqline(const char *mask, const char *reason); void ratbox_cmd_squit(const char *servname, const char *message); void ratbox_cmd_svso(const char *source, const char *nick, const char *flag); @@ -111,4 +110,5 @@ class RatboxProto : public IRCDProtoNew { void cmd_unsqline(const char *); void cmd_invite(const char *, const char *, const char *); void cmd_part(const char *, const char *, const char *); + void cmd_global(const char *, const char *); } ircd_proto; diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index f8eb5396a..af08770f3 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -856,17 +856,6 @@ void unreal_cmd_211(const char *buf) send_cmd(NULL, "211 %s", buf); } -/* GLOBOPS */ -void unreal_cmd_global(const char *source, const char *buf) -{ - if (!buf) { - return; - } - - send_cmd(source ? source : ServerName, "%s :%s", - send_token("GLOBOPS", "]"), buf); -} - /* SQLINE */ /* ** parv[0] = sender @@ -2004,7 +1993,6 @@ void moduleAddAnopeCmds() pmodule_cmd_242(unreal_cmd_242); pmodule_cmd_243(unreal_cmd_243); pmodule_cmd_211(unreal_cmd_211); - pmodule_cmd_global(unreal_cmd_global); pmodule_cmd_sqline(unreal_cmd_sqline); pmodule_cmd_squit(unreal_cmd_squit); pmodule_cmd_svso(unreal_cmd_svso); diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h index 4abe97fde..d91b39e48 100644 --- a/src/protocol/unreal32.h +++ b/src/protocol/unreal32.h @@ -98,7 +98,6 @@ void unreal_cmd_318(const char *source, const char *who); void unreal_cmd_242(const char *buf); void unreal_cmd_243(const char *buf); void unreal_cmd_211(const char *buf); -void unreal_cmd_global(const char *source, const char *buf); void unreal_cmd_sqline(const char *mask, const char *reason); void unreal_cmd_squit(const char *servname, const char *message); void unreal_cmd_svso(const char *source, const char *nick, const char *flag); |