summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-03 08:00:31 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-03 08:00:31 +0000
commit968616980cea24f38b7c15301a29f3adad7cb6b3 (patch)
tree299d93b502c9e4498304033134ce12e04e7f519c /include
parent797bdccb9ba4d5bd82021d8de1ae671629c41f96 (diff)
Merge commit 'cbx/anopeng-uid' into anopeng-uid
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1395 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
-rw-r--r--include/extern.h17
-rw-r--r--include/services.h39
2 files changed, 24 insertions, 32 deletions
diff --git a/include/extern.h b/include/extern.h
index 1c517a1b7..694d4e3ff 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -1123,25 +1123,8 @@ E void anope_cmd_protoctl(); /* PRO
E void anope_cmd_svinfo(); /* SVINFO */
E void anope_cmd_svsadmin(const char *server, int set); /* SVSADMIN */
E void anope_cmd_svsinfo(); /* SVSINFO */
-E void anope_SendSVSJoin(const char *source, const char *nick,const char *chan, const char *param); /* SVSJOIN */
-E void anope_SendSVSPart(const char *source, const char *nick,const char *chan); /* SVSPART */
-E void anope_SendSWhois(const char *source, const char *who, const char *mask); /* SWHOIS */
-E void anope_SendEOB(); /* EOB - end of burst */
E void anope_cmd_burst(); /* BURST - use eob to send burst 0 */
E void anope_cmd_svswatch(const char *sender, const char *nick, const char *parm);
-E void anope_SendCTCP(const char *source, const char *dest, const char *fmt, ...); /* CTCP */
-E void anope_SendNumeric(const char *, int, const char *, const char *, ...) FORMAT(printf, 4, 5); /* Numerics */
-
-E void anope_ProcessUsermodes(User * user, int ac, const char **av);
-E void anope_SendSVID2(User *u, const char *ts);
-E void anope_SendSVID3(User *u, const char *ts);
-E void anope_SendUnregisteredNick(User *u);
-E int anope_IsFloodModeParamValid(const char *value);
-
-E void anope_SendJupe(const char *jserver, const char *who, const char *reason);
-
-E int anope_IsNickValid(const char *nick);
-E int anope_IsChannelValid(const char *chan);
E char *common_get_vident(User *u);
E char *common_get_vhost(User *u);
diff --git a/include/services.h b/include/services.h
index d3a97c83b..3fbb7f263 100644
--- a/include/services.h
+++ b/include/services.h
@@ -1272,6 +1272,16 @@ class IRCDProto {
else
send_cmd(ServerName, "GLOBOPS :%s", buf);
}
+ virtual void SendCTCPInternal(BotInfo *bi, const char *dest, const char *buf)
+ {
+ char *s = normalizeBuffer(buf);
+ send_cmd(UseTS6 ? bi->uid : bi->nick, "NOTICE %s :\1%s\1", dest, s);
+ free(s);
+ }
+ virtual void SendNumericInternal(const char *source, int numeric, const char *dest, const char *buf)
+ {
+ send_cmd(source, "%03d %s %s", numeric, dest, buf);
+ }
public:
virtual void SendSVSNOOP(const char *, int) { }
virtual void SendAkillDel(const char *, const char *) = 0;
@@ -1441,33 +1451,32 @@ class IRCDProto {
virtual void SendUnregisteredNick(User *) { }
virtual void SendSVID2(User *, const char *) { }
virtual void SendSVID3(User *, const char *) { }
- virtual void SendCTCP(BotInfo *bi, const char *dest, const char *buf)
+ virtual void SendCTCP(BotInfo *bi, const char *dest, const char *fmt, ...)
{
- char *s = normalizeBuffer(buf);
- send_cmd(UseTS6 ? bi->uid : bi->nick, "NOTICE %s :\1%s\1", dest, s);
- free(s);
+ va_list args;
+ char buf[BUFSIZE] = "";
+ va_start(args, fmt);
+ vsnprintf(buf, BUFSIZE - 1, fmt, args);
+ va_end(args);
+ SendCTCPInternal(bi, dest, buf);
}
virtual void SendSVSJoin(const char *, const char *, const char *, const char *) { }
virtual void SendSVSPart(const char *, const char *, const char *) { }
virtual void SendSWhois(const char *, const char *, const char *) { }
virtual void SendEOB() { }
virtual void SendServer(const char *, int, const char *) = 0;
- virtual void SendJupe(const char *jserver, const char *who, const char *reason)
- {
- // XXX: this should NOT be done here. protocol modules are *only* for protocol. -- w00t
- char rbuf[256];
- snprintf(rbuf, sizeof(rbuf), "Juped by %s%s%s", who, reason ? ": " : "", reason ? reason : "");
- if (findserver(servlist, jserver)) SendSquit(jserver, rbuf);
- SendServer(jserver, 2, rbuf);
- new_server(me_server, jserver, rbuf, SERVER_JUPED, NULL);
- }
virtual void ProcessUsermodes(User *, int, const char **) = 0;
virtual int IsNickValid(const char *) { return 1; }
virtual int IsChannelValid(const char *) { return 1; }
virtual int IsFloodModeParamValid(const char *) { return 0; }
- virtual void SendNumeric(const char *source, int numeric, const char *dest, const char *buf)
+ virtual void SendNumeric(const char *source, int numeric, const char *dest, const char *fmt, ...)
{
- send_cmd(source, "%03d %s %s", numeric, dest, buf);
+ va_list args;
+ char buf[BUFSIZE] = "";
+ va_start(args, fmt);
+ vsnprintf(buf, BUFSIZE - 1, fmt, args);
+ va_end(args);
+ SendNumericInternal(source, numeric, dest, *buf ? buf : NULL);
}
};