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

Replaced anope_SendPart() with direct call to SendPart() in IRCDProto class.

Added SendPartInternal() function to IRCDProto class, now SendPart() is a stub to handle varargs.


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1346 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Naram Qashat cyberbotx@cyberbotx.com
2008-10-02 20:35:07 +00:00
parent de32f2b192
commit f3f1b97a1a
13 changed files with 31 additions and 33 deletions
-1
View File
@@ -1123,7 +1123,6 @@ E void anope_cmd_tmode(const char *source, const char *dest, const char *fmt, ..
E void anope_SendBanDel(const char *name, const char *nick); /* MODE -b */
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_SendPart(const char *nick, const char *chan, const char *fmt, ...); /* PART */
E void anope_cmd_pass(const char *pass); /* PASS */
E void anope_cmd_protoctl(); /* PROTOCTL */
E void anope_SendSGLine(const char *mask, const char *reason); /* SGLINE */
+17 -5
View File
@@ -1256,6 +1256,13 @@ class IRCDProto {
else
send_cmd(UseTS6 ? bi->uid : bi->nick, "QUIT");
}
virtual void SendPartInternal(const char *nick, const char *chan, const char *buf)
{
if (buf)
send_cmd(nick, "PART %s :%s", chan, buf);
else
send_cmd(nick, "PART %s", chan);
}
public:
virtual void SendSVSNOOP(const char *, int) { }
virtual void SendAkillDel(const char *, const char *) = 0;
@@ -1390,12 +1397,17 @@ class IRCDProto {
{
send_cmd(UseTS6 ? bi->uid : bi->nick, "INVITE %s %s", nick, chan);
}
virtual void SendPart(const char *nick, const char *chan, const char *buf)
virtual void SendPart(const char *nick, const char *chan, const char *fmt, ...)
{
if (buf)
send_cmd(nick, "PART %s :%s", chan, buf);
else
send_cmd(nick, "PART %s", chan);
if (fmt) {
va_list args;
char buf[BUFSIZE] = "";
va_start(args, fmt);
vsnprintf(buf, BUFSIZE - 1, fmt, args);
va_end(args);
SendPartInternal(nick, chan, buf);
}
else SendPartInternal(nick, chan, NULL);
}
virtual void SendGlobops(const char *source, const char *buf)
{
+1 -1
View File
@@ -108,7 +108,7 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci)
send_event(EVENT_BOT_UNASSIGN, 2, ci->name, ci->bi->nick);
if (u && ci->c && ci->c->usercount >= BSMinUsers)
anope_SendPart(ci->bi->nick, ci->name, "UNASSIGN from %s", u->nick);
ircdproto->SendPart(ci->bi->nick, ci->name, "UNASSIGN from %s", u->nick);
ci->bi->chancount--;
ci->bi = NULL;
+2 -2
View File
@@ -49,7 +49,7 @@ void chan_deluser(User * user, Channel * c)
c->usercount--;
if (s_BotServ && c->ci && c->ci->bi && c->usercount == BSMinUsers - 1) {
anope_SendPart(c->ci->bi->nick, c->name, NULL);
ircdproto->SendPart(c->ci->bi->nick, c->name, NULL);
}
if (!c->users)
@@ -790,7 +790,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (c->ci && c->ci->bi) {
/* This is ugly, but it always works */
anope_SendPart(c->ci->bi->nick, c->name, "TS reop");
ircdproto->SendPart(c->ci->bi->nick, c->name, "TS reop");
bot_join(c->ci);
}
/* XXX simple modes and bans */
+4 -4
View File
@@ -1244,7 +1244,7 @@ static void timeout_leave(Timeout * to)
if (ci) /* Check cos the channel may be dropped in the meantime */
ci->flags &= ~CI_INHABIT;
anope_SendPart(s_ChanServ, chan, NULL);
ircdproto->SendPart(s_ChanServ, chan, NULL);
free(to->data);
}
@@ -1456,7 +1456,7 @@ void restore_topic(const char *chan)
c->topic ? c->topic : "", c->topic_time);
if (ircd->join2set) {
if (whosends(ci) == s_ChanServ) {
anope_SendPart(s_ChanServ, c->name, NULL);
ircdproto->SendPart(s_ChanServ, c->name, NULL);
}
}
}
@@ -1520,7 +1520,7 @@ int check_topiclock(Channel * c, time_t topic_time)
if (ircd->join2set) {
if (whosends(ci) == s_ChanServ) {
anope_SendPart(s_ChanServ, c->ci->name, NULL);
ircdproto->SendPart(s_ChanServ, c->ci->name, NULL);
}
}
return 1;
@@ -1778,7 +1778,7 @@ int delchan(ChannelInfo * ci)
}
if (ci->c) {
if (ci->bi && ci->c->usercount >= BSMinUsers) {
anope_SendPart(ci->bi->nick, ci->c->name, NULL);
ircdproto->SendPart(ci->bi->nick, ci->c->name, NULL);
}
ci->c->ci = NULL;
}
+1 -1
View File
@@ -111,7 +111,7 @@ int do_cs_topic(User * u)
c->topic_time);
if (ircd->join2set) {
if (whosends(ci) == s_ChanServ) {
anope_SendPart(s_ChanServ, c->name, NULL);
ircdproto->SendPart(s_ChanServ, c->name, NULL);
}
}
}
+1 -1
View File
@@ -195,7 +195,7 @@ int do_set(User * u)
} else if (LogChannel && (stricmp(setting, "off") == 0)) {
alog("No longer sending log messages to a channel");
if (ircd->join2msg) {
anope_SendPart(s_GlobalNoticer, LogChannel, NULL);
ircdproto->SendPart(s_GlobalNoticer, LogChannel, NULL);
}
logchan = 0;
notice_lang(s_OperServ, u, OPER_SET_LOGCHAN_OFF);
-13
View File
@@ -43,19 +43,6 @@ void anope_ProcessUsermodes(User *user, int ac, const char **av)
ircdproto->ProcessUsermodes(user, ac, av);
}
void anope_SendPart(const char *nick, const char *chan, const char *fmt, ...)
{
if (fmt) {
va_list args;
char buf[BUFSIZE] = "";
va_start(args, fmt);
vsnprintf(buf, BUFSIZE - 1, fmt, args);
va_end(args);
ircdproto->SendPart(nick, chan, buf);
}
else ircdproto->SendPart(nick, chan, NULL);
}
void anope_SendGlobops(const char *source, const char *fmt, ...)
{
va_list args;
+1 -1
View File
@@ -154,7 +154,7 @@ int my_cs_appendtopic(User * u)
ircdproto->SendTopic(whosends(ci), c->name, u->nick, topic, c->topic_time);
if (ircd->join2set) {
if (whosends(ci) == s_ChanServ) {
anope_SendPart(s_ChanServ, c->name, NULL);
ircdproto->SendPart(s_ChanServ, c->name, NULL);
}
}
}
+1 -1
View File
@@ -813,7 +813,7 @@ void CharybdisProto::SendClientIntroduction(const char *nick, const char *user,
SendSQLine(nick, "Reserved for services");
}
void CharybdisProto::SendPart(const char *nick, const char *chan, const char *buf)
void CharybdisProto::SendPartInternal(const char *nick, const char *chan, const char *buf)
{
User *u = finduser(nick);
if (buf) send_cmd(UseTS6 ? u->uid : nick, "PART %s :%s", chan, buf);
+1 -1
View File
@@ -52,6 +52,7 @@ class CharybdisProto : public IRCDTS6Proto {
void SendKickInternal(const char *, const char *, const char *, const char *);
void SendNoticeChanopsInternal(const char *, const char *, const char *);
void SendQuitInternal(const char *, const char *);
void SendPartInternal(const char *, const char *, const char *);
public:
void SendAkillDel(const char *, const char *);
void SendVhostDel(User *);
@@ -63,7 +64,6 @@ class CharybdisProto : public IRCDTS6Proto {
void SendJoin(const char *, const char *, time_t);
void SendSQLineDel(const char *);
void SendInvite(const char *, const char *, const char *);
void SendPart(const char *, const char *, const char *);
void SendGlobops(const char *, const char *);
void SendSQLine(const char *, const char *);
void SendForceNickChange(const char *, const char *, time_t);
+1 -1
View File
@@ -750,7 +750,7 @@ void RatboxProto::SendClientIntroduction(const char *nick, const char *user, con
SendSQLine(nick, "Reserved for services");
}
void RatboxProto::SendPart(const char *nick, const char *chan, const char *buf)
void RatboxProto::SendPartInternal(const char *nick, const char *chan, const char *buf)
{
Uid *ud = find_uid(nick);
if (buf) send_cmd(UseTS6 ? ud->uid : nick, "PART %s :%s", chan, buf);
+1 -1
View File
@@ -51,6 +51,7 @@ class RatboxProto : public IRCDTS6Proto {
void SendKickInternal(const char *, const char *, const char *, const char *);
void SendNoticeChanopsInternal(const char *, const char *, const char *);
void SendQuitInternal(const char *, const char *);
void SendPartInternal(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 *);
@@ -61,7 +62,6 @@ class RatboxProto : public IRCDTS6Proto {
void SendJoin(const char *, const char *, time_t);
void SendSQLineDel(const char *);
void SendInvite(const char *, const char *, const char *);
void SendPart(const char *, const char *, const char *);
void SendGlobops(const char *, const char *);
void SendSQLine(const char *, const char *);
void SendForceNickChange(const char *, const char *, time_t) { } // Ratbox doesn't have an SVSNICK command