mirror of
https://github.com/anope/anope.git
synced 2026-07-02 04:06:39 +02:00
Added cmd_global() function to IRCDProtoNew class.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1242 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -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));
|
||||
|
||||
+5
-1
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
+8
-15
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
+11
-18
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
+10
-18
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user