diff options
author | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 18:44:47 +0000 |
---|---|---|
committer | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 18:44:47 +0000 |
commit | c48429eb7515583de22bc8134493b3bfad2df0c4 (patch) | |
tree | 5cd81bb541214fd471872d3c39338c0a372fd3ba | |
parent | 765f561952d1a77a445128d7cbdc0da0a16c1706 (diff) |
Replaced anope_SendNoticeChanops() with direct call to SendNoticeChanops() in IRCDProto class.
Also added SendNoticeChanopsInternal() function to IRCDProto class, now SendNoticeChanops() is a stub to handle varargs.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1332 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | include/services.h | 13 | ||||
-rw-r--r-- | src/botserv.c | 2 | ||||
-rw-r--r-- | src/ircd.c | 12 | ||||
-rw-r--r-- | src/protocol/bahamut.c | 2 | ||||
-rw-r--r-- | src/protocol/bahamut.h | 2 | ||||
-rw-r--r-- | src/protocol/charybdis.c | 2 | ||||
-rw-r--r-- | src/protocol/charybdis.h | 2 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 2 | ||||
-rwxr-xr-x | src/protocol/inspircd11.h | 2 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 2 | ||||
-rw-r--r-- | src/protocol/ratbox.h | 2 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 2 | ||||
-rw-r--r-- | src/protocol/unreal32.h | 2 |
14 files changed, 23 insertions, 25 deletions
diff --git a/include/extern.h b/include/extern.h index c2231ff01..a6416bf80 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1130,7 +1130,6 @@ E void anope_SendBotOp(const char *nick, const char *chan); /* MODE BotS E void anope_cmd_netinfo(int ac, const char **av); /* NETINFO */ E void anope_SendChangeBotNick(const char *oldnick, const char *newnick); /* NICK */ E void anope_cmd_message(const char *source, const char *dest, const char *fmt, ...); /* NOTICE */ -E void anope_SendNoticeChanops(const char *source, const char *dest, const char *fmt, ...); /* NOTICE */ E void anope_cmd_notice(const char *source, const char *dest, const char *msg); /* NOTICE */ E void anope_SendGlobalNotice(const char *source, const char *dest, const char *msg); /* NOTICE */ E void anope_SendPart(const char *nick, const char *chan, const char *fmt, ...); /* PART */ diff --git a/include/services.h b/include/services.h index ce82b97dd..58c0570f8 100644 --- a/include/services.h +++ b/include/services.h @@ -1233,6 +1233,7 @@ class IRCDProto { virtual void SendSVSKillInternal(const char *, const char *, const char *) = 0; virtual void SendModeInternal(const char *, const char *, const char *) = 0; virtual void SendKickInternal(const char *, const char *, const char *, const char *) = 0; + virtual void SendNoticeChanopsInternal(const char *, const char *, const char *) = 0; public: virtual void SendSVSNOOP(const char *, int) { } virtual void SendAkillDel(const char *, const char *) = 0; @@ -1275,7 +1276,17 @@ class IRCDProto { } SendKickInternal(source, chan, user, buf); } - virtual void SendNoticeChanops(const char *, const char *, const char *) = 0; + virtual void SendNoticeChanops(const char *source, const char *dest, const char *fmt, ...) + { + va_list args; + char buf[BUFSIZE] = ""; + if (fmt) { + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + } + SendNoticeChanopsInternal(source, dest, buf); + } virtual void SendMessage(BotInfo *bi, const char *dest, const char *buf) { if (NSDefFlags & NI_MSG) diff --git a/src/botserv.c b/src/botserv.c index 5b3c7f8d4..5705b1e27 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -746,7 +746,7 @@ void bot_join(ChannelInfo * ci) /* Should we be invited? */ if ((ci->c->mode & anope_get_invite_mode()) || (ci->c->limit && ci->c->usercount >= ci->c->limit)) - anope_SendNoticeChanops(NULL, ci->c->name, + ircdproto->SendNoticeChanops(NULL, ci->c->name, "%s invited %s into the channel.", ci->bi->nick, ci->bi->nick); } diff --git a/src/ircd.c b/src/ircd.c index f347e0014..999bbf515 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -43,18 +43,6 @@ void anope_ProcessUsermodes(User *user, int ac, const char **av) ircdproto->ProcessUsermodes(user, ac, av); } -void anope_SendNoticeChanops(const char *source, const char *dest, const char *fmt, ...) -{ - va_list args; - char buf[BUFSIZE] = ""; - if (fmt) { - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - va_end(args); - } - ircdproto->SendNoticeChanops(source, dest, buf); -} - void anope_cmd_message(const char *source, const char *dest, const char *fmt, ...) { va_list args; diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index d269b9cd8..975467972 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -872,7 +872,7 @@ int anope_event_motd(const char *source, int ac, const char **av) return MOD_CONT; } -void BahamutIRCdProto::SendNoticeChanops(const char *source, const char *dest, const char *buf) +void BahamutIRCdProto::SendNoticeChanopsInternal(const char *source, const char *dest, const char *buf) { if (!buf) return; send_cmd(NULL, "NOTICE @%s :%s", dest, buf); diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index b99122c24..59687bfcd 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -62,6 +62,7 @@ class BahamutIRCdProto : public IRCDProto { void SendSVSKillInternal(const char *, const char *, const char *); void SendModeInternal(const char *, const char *, const char *); void SendKickInternal(const char *, const char *, const char *, const char *); + void SendNoticeChanopsInternal(const char *, const char *, const char *); public: void SendSVSNOOP(const char *, int); void SendAkillDel(const char *, const char *); @@ -70,7 +71,6 @@ class BahamutIRCdProto : public IRCDProto { void SendSVSMode(User *, int, const char **); void SendGuestNick(const char *, const char *, const char *, const char *, const char *); void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *); - void SendNoticeChanops(const char *, const char *, const char *); void SendBotOp(const char *, const char *); void SendJoin(const char *, const char *, time_t); void SendSQLineDel(const char *); diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 6f9034bfc..c36e18a25 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -1019,7 +1019,7 @@ void CharybdisProto::SendKickInternal(const char *source, const char *chan, cons else send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "KICK %s %s", chan, UseTS6 ? (u ? u->uid : user) : user); } -void CharybdisProto::SendNoticeChanops(const char *source, const char *dest, const char *buf) +void CharybdisProto::SendNoticeChanopsInternal(const char *source, const char *dest, const char *buf) { if (!buf) return; BotInfo *bi = findbot(source); diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h index 30c7f769d..ac41d22a2 100644 --- a/src/protocol/charybdis.h +++ b/src/protocol/charybdis.h @@ -50,13 +50,13 @@ class CharybdisProto : public IRCDTS6Proto { void SendSVSKillInternal(const char *, const char *, const char *); void SendModeInternal(const char *, const char *, const char *); void SendKickInternal(const char *, const char *, const char *, const char *); + void SendNoticeChanopsInternal(const char *, const char *, const char *); public: void SendAkillDel(const char *, const char *); void SendVhostDel(User *); void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *); void SendSVSMode(User *, int, const char **); void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *); - void SendNoticeChanops(const char *, const char *, const char *); void SendBotOp(const char *, const char *); void SendQuit(const char *, const char *); void SendPong(const char *, const char *); diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 3e7ef8f32..fed17d4f4 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -739,7 +739,7 @@ void InspIRCdProto::SendKickInternal(const char *source, const char *chan, const else send_cmd(source, "KICK %s %s :%s", chan, user, user); } -void InspIRCdProto::SendNoticeChanops(const char *source, const char *dest, const char *buf) +void InspIRCdProto::SendNoticeChanopsInternal(const char *source, const char *dest, const char *buf) { if (!buf) return; send_cmd(ServerName, "NOTICE @%s :%s", dest, buf); diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h index ad3d47fec..ddf679a2d 100755 --- a/src/protocol/inspircd11.h +++ b/src/protocol/inspircd11.h @@ -55,6 +55,7 @@ class InspIRCdProto : public IRCDProto { void SendSVSKillInternal(const char *, const char *, const char *); void SendModeInternal(const char *, const char *, const char *); void SendKickInternal(const char *, const char *, const char *, const char *); + void SendNoticeChanopsInternal(const char *, const char *, const char *); public: void SendAkillDel(const char *, const char *); void SendTopic(BotInfo *, const char *, const char *, const char *, time_t); @@ -63,7 +64,6 @@ class InspIRCdProto : public IRCDProto { void SendSVSMode(User *, int, const char **); void SendGuestNick(const char *, const char *, const char *, const char *, const char *); void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *); - void SendNoticeChanops(const char *, const char *, const char *); void SendBotOp(const char *, const char *); void SendJoin(const char *, const char *, time_t); void SendSQLineDel(const char *); diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index c669e366f..717c71f92 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -949,7 +949,7 @@ void RatboxProto::SendKickInternal(const char *source, const char *chan, const c else send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KICK %s %s", chan, UseTS6 ? (u ? u->uid : user) : user); } -void RatboxProto::SendNoticeChanops(const char *source, const char *dest, const char *buf) +void RatboxProto::SendNoticeChanopsInternal(const char *source, const char *dest, const char *buf) { if (!buf) return; send_cmd(NULL, "NOTICE @%s :%s", dest, buf); diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h index cb4384fd2..3a8a96e1e 100644 --- a/src/protocol/ratbox.h +++ b/src/protocol/ratbox.h @@ -49,12 +49,12 @@ class RatboxProto : public IRCDTS6Proto { void SendSVSKillInternal(const char *, const char *, const char *); void SendModeInternal(const char *, const char *, const char *); void SendKickInternal(const char *, const char *, const char *, const char *); + void SendNoticeChanopsInternal(const char *, const char *, const char *); public: void SendAkillDel(const char *, const char *); void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *); void SendSVSMode(User *, int, const char **); void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *); - void SendNoticeChanops(const char *, const char *, const char *); void SendBotOp(const char *, const char *); void SendQuit(const char *, const char *); void SendPong(const char *, const char *); diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 960dcf8db..61690dcaf 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -562,7 +562,7 @@ void UnrealIRCdProto::SendKickInternal(const char *source, const char *chan, con else send_cmd(source, "%s %s %s", send_token("KICK", "H"), chan, user); } -void UnrealIRCdProto::SendNoticeChanops(const char *source, const char *dest, const char *buf) +void UnrealIRCdProto::SendNoticeChanopsInternal(const char *source, const char *dest, const char *buf) { if (!buf) return; send_cmd(source, "%s @%s :%s", send_token("NOTICE", "B"), dest, buf); diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h index 137c1cdd1..27d161d0c 100644 --- a/src/protocol/unreal32.h +++ b/src/protocol/unreal32.h @@ -84,6 +84,7 @@ class UnrealIRCdProto : public IRCDProto { void SendSVSKillInternal(const char *, const char *, const char *); void SendModeInternal(const char *, const char *, const char *); void SendKickInternal(const char *, const char *, const char *, const char *); + void SendNoticeChanopsInternal(const char *, const char *, const char *); public: void SendSVSNOOP(const char *, int); void SendAkillDel(const char *, const char *); @@ -93,7 +94,6 @@ class UnrealIRCdProto : public IRCDProto { void SendSVSMode(User *, int, const char **); void SendGuestNick(const char *, const char *, const char *, const char *, const char *); void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *); - void SendNoticeChanops(const char *, const char *, const char *); void SendBotOp(const char *, const char *); void SendJoin(const char *, const char *, time_t); void SendSQLineDel(const char *); |