summaryrefslogtreecommitdiff
path: root/src/protocol/ratbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/ratbox.c')
-rw-r--r--src/protocol/ratbox.c614
1 files changed, 330 insertions, 284 deletions
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index bf579c7e1..e6fe2755c 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -13,7 +13,39 @@
#include "services.h"
#include "pseudo.h"
-#include "ratbox.h"
+
+#define UMODE_a 0x00000001
+#define UMODE_C 0x00000002
+#define UMODE_i 0x00000004
+#define UMODE_o 0x00000008
+#define UMODE_z 0x00000010
+#define UMODE_w 0x00000020
+#define UMODE_s 0x00000040
+#define UMODE_c 0x00000080
+#define UMODE_r 0x00000100
+#define UMODE_k 0x00000200
+#define UMODE_f 0x00000400
+#define UMODE_y 0x00000800
+#define UMODE_d 0x00001000
+#define UMODE_n 0x00002000
+#define UMODE_x 0x00004000
+#define UMODE_u 0x00008000
+#define UMODE_b 0x00010000
+#define UMODE_l 0x00020000
+#define UMODE_g 0x00040000
+#define UMODE_Z 0x00080000
+
+#define CMODE_i 0x00000001
+#define CMODE_m 0x00000002
+#define CMODE_n 0x00000004
+#define CMODE_p 0x00000008
+#define CMODE_s 0x00000010
+#define CMODE_t 0x00000020
+#define CMODE_k 0x00000040
+#define CMODE_l 0x00000080
+
+
+#define DEFAULT_MLOCK CMODE_n | CMODE_t
IRCDVar myIrcd[] = {
{"Ratbox 2.0+", /* ircd name */
@@ -145,35 +177,6 @@ IRCDCAPAB myIrcdcap[] = {
0, 0, 0}
};
-void RatboxProto::ProcessUsermodes(User *user, int ac, const char **av)
-{
- int add = 1; /* 1 if adding modes, 0 if deleting */
- const char *modes = av[0];
- --ac;
- if (debug) alog("debug: Changing mode for %s to %s", user->nick, modes);
- while (*modes) {
- /* This looks better, much better than "add ? (do_add) : (do_remove)".
- * At least this is readable without paying much attention :) -GD */
- if (add) user->mode |= umodes[static_cast<int>(*modes)];
- else user->mode &= ~umodes[static_cast<int>(*modes)];
- switch (*modes++) {
- case '+':
- add = 1;
- break;
- case '-':
- add = 0;
- break;
- case 'o':
- if (add) {
- ++opcnt;
- if (WallOper) ircdproto->SendGlobops(s_OperServ, "\2%s\2 is now an IRC operator.", user->nick);
- display_news(user, NEWS_OPER);
- }
- else --opcnt;
- }
- }
-}
-
unsigned long umodes[128] = {
0, 0, 0, /* Unused */
0, 0, 0, /* Unused */
@@ -425,18 +428,304 @@ CUMode myCumodes[128] = {
-void RatboxProto::SendGlobopsInternal(const char *source, const char *buf)
+
+/*
+ * SVINFO
+ * parv[0] = sender prefix
+ * parv[1] = TS_CURRENT for the server
+ * parv[2] = TS_MIN for the server
+ * parv[3] = server is standalone or connected to non-TS only
+ * parv[4] = server's idea of UTC time
+ */
+void ratbox_cmd_svinfo()
+{
+ send_cmd(NULL, "SVINFO 6 3 0 :%ld", (long int) time(NULL));
+}
+
+void ratbox_cmd_svsinfo()
+{
+
+}
+
+void ratbox_cmd_tmode(const char *source, const char *dest, 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);
+ }
+ if (!*buf) {
+ return;
+ }
+
+ send_cmd(NULL, "MODE %s %s", dest, buf);
+}
+
+
+/* CAPAB */
+/*
+ QS - Can handle quit storm removal
+ EX - Can do channel +e exemptions
+ CHW - Can do channel wall @#
+ LL - Can do lazy links
+ IE - Can do invite exceptions
+ EOB - Can do EOB message
+ KLN - Can do KLINE message
+ GLN - Can do GLINE message
+ HUB - This server is a HUB
+ UID - Can do UIDs
+ ZIP - Can do ZIPlinks
+ ENC - Can do ENCrypted links
+ KNOCK - supports KNOCK
+ TBURST - supports TBURST
+ PARA - supports invite broadcasting for +p
+ ENCAP - ?
+*/
+void ratbox_cmd_capab()
+{
+ send_cmd(NULL,
+ "CAPAB :QS EX CHW IE KLN GLN KNOCK TB UNKLN CLUSTER ENCAP");
+}
+
+/* PASS */
+void ratbox_cmd_pass(const char *pass)
+{
+ if (UseTS6) {
+ send_cmd(NULL, "PASS %s TS 6 :%s", pass, TS6SID);
+ } else {
+ send_cmd(NULL, "PASS %s :TS", pass);
+ }
+}
+
+class RatboxProto : public IRCDTS6Proto
{
- if (!buf) return;
- if (source) {
- Uid *u = find_uid(source);
- if (u) {
- send_cmd(UseTS6 ? u->uid : source, "OPERWALL :%s", buf);
- return;
+ void ProcessUsermodes(User *user, int ac, const char **av)
+ {
+ int add = 1; /* 1 if adding modes, 0 if deleting */
+ const char *modes = av[0];
+ --ac;
+ if (debug) alog("debug: Changing mode for %s to %s", user->nick, modes);
+ while (*modes) {
+ /* This looks better, much better than "add ? (do_add) : (do_remove)".
+ * At least this is readable without paying much attention :) -GD */
+ if (add) user->mode |= umodes[static_cast<int>(*modes)];
+ else user->mode &= ~umodes[static_cast<int>(*modes)];
+ switch (*modes++) {
+ case '+':
+ add = 1;
+ break;
+ case '-':
+ add = 0;
+ break;
+ case 'o':
+ if (add) {
+ ++opcnt;
+ if (WallOper) ircdproto->SendGlobops(s_OperServ, "\2%s\2 is now an IRC operator.", user->nick);
+ display_news(user, NEWS_OPER);
+ }
+ else --opcnt;
+ }
}
}
- send_cmd(UseTS6 ? TS6SID : ServerName, "OPERWALL :%s", buf);
-}
+
+ void SendGlobopsInternal(const char *source, const char *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);
+ }
+
+ void SendSQLine(const char *mask, const char *reason)
+ {
+ Uid *ud = find_uid(s_OperServ);
+ send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "RESV * %s :%s", mask, reason);
+ }
+
+ void SendSGLineDel(const char *mask)
+ {
+ Uid *ud = find_uid(s_OperServ);
+ send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNXLINE * %s", mask);
+ }
+
+ void SendSGLine(const char *mask, const char *reason)
+ {
+ Uid *ud = find_uid(s_OperServ);
+ send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "XLINE * %s 0 :%s", mask, reason);
+ }
+
+ void SendAkillDel(const char *user, const char *host)
+ {
+ Uid *ud = find_uid(s_OperServ);
+ send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNKLINE * %s %s", user, host);
+ }
+
+ void SendSQLineDel(const char *user)
+ {
+ Uid *ud = find_uid(s_OperServ);
+ send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNRESV * %s", user);
+ }
+
+ void SendJoin(BotInfo *user, const char *channel, time_t chantime)
+ {
+ send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel, UseTS6 ? user->uid.c_str() : user->nick);
+ }
+
+ /*
+ oper: the nick of the oper performing the kline
+ target.server: the server(s) this kline is destined for
+ duration: the duration if a tkline, 0 if permanent.
+ user: the 'user' portion of the kline
+ host: the 'host' portion of the kline
+ reason: the reason for the kline.
+ */
+
+ void SendAkill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
+ {
+ Uid *ud = find_uid(s_OperServ);
+ send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(expires - time(NULL)), user, host, reason);
+ }
+
+ void SendSVSKillInternal(const char *source, const char *user, const char *buf)
+ {
+ if (!source || !user || !buf) return;
+ Uid *ud = find_uid(source), *ud2 = find_uid(user);
+ send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KILL %s :%s", UseTS6 ? (ud2 ? ud2->uid : user) : user, buf);
+ }
+
+ void SendSVSMode(User *u, int ac, const char **av)
+ {
+ send_cmd(UseTS6 ? TS6SID : ServerName, "SVSMODE %s %s", u->nick, av[0]);
+ }
+
+ /* SERVER name hop descript */
+ void SendServer(const char *servname, int hop, const char *descript)
+ {
+ send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript);
+ }
+
+ void SendConnect()
+ {
+ /* Make myself known to myself in the serverlist */
+ if (UseTS6) me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, TS6SID);
+ else me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
+ if (servernum == 1) ratbox_cmd_pass(RemotePassword);
+ else if (servernum == 2) ratbox_cmd_pass(RemotePassword2);
+ else if (servernum == 3) ratbox_cmd_pass(RemotePassword3);
+ ratbox_cmd_capab();
+ SendServer(ServerName, 1, ServerDesc);
+ ratbox_cmd_svinfo();
+ }
+
+ void SendClientIntroduction(const char *nick, const char *user, const char *host, const char *real, const char *modes)
+ {
+ EnforceQlinedNick(nick, NULL);
+ if (UseTS6) {
+ char *uidbuf = ts6_uid_retrieve();
+ send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0 %s :%s", nick, static_cast<long>(time(NULL)), modes, user, host, uidbuf, real);
+ new_uid(nick, uidbuf);
+ }
+ else send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, static_cast<long>(time(NULL)), modes, user, host, ServerName, real);
+ SendSQLine(nick, "Reserved for services");
+ }
+
+ void SendPartInternal(BotInfo *nick, const char *chan, const char *buf)
+ {
+ Uid *ud = find_uid(nick);
+ if (buf) send_cmd(UseTS6 ? ud->uid : nick->nick, "PART %s :%s", chan, buf);
+ else send_cmd(UseTS6 ? ud->uid : nick->nick, "PART %s", chan);
+ }
+
+ void SendNumericInternal(const char *source, int numeric, const char *dest, const char *buf)
+ {
+ // This might need to be set in the call to SendNumeric instead of here, will review later -- CyberBotX
+ send_cmd(UseTS6 ? TS6SID : source, "%03d %s %s", numeric, dest, buf);
+ }
+
+ void SendModeInternal(BotInfo *source, const char *dest, const char *buf)
+ {
+ if (!buf) return;
+ if (source) {
+ Uid *ud = find_uid(source);
+ send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "MODE %s %s", dest, buf);
+ }
+ else send_cmd(source->nick, "MODE %s %s", dest, buf);
+ }
+
+ void SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf)
+ {
+ Uid *ud = find_uid(source);
+ User *u = finduser(user);
+ if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "KICK %s %s :%s", chan, UseTS6 ? (u ? u->uid : user) : user, buf);
+ else send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "KICK %s %s", chan, UseTS6 ? (u ? u->uid : user) : user);
+ }
+
+ void SendNoticeChanopsInternal(BotInfo *source, const char *dest, const char *buf)
+ {
+ if (!buf) return;
+ send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
+ }
+
+ void SendBotOp(const char *nick, const char *chan)
+ {
+ if (UseTS6) {
+ Uid *u = find_uid(nick);
+ ratbox_cmd_tmode(nick, chan, "%s %s", ircd->botchanumode, u ? u->uid : nick);
+ }
+ else SendMode(findbot(nick), chan, "%s %s", ircd->botchanumode, nick);
+ }
+
+ /* QUIT */
+ void SendQuitInternal(BotInfo *source, const char *buf)
+ {
+ Uid *ud = find_uid(source);
+ if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "QUIT :%s", buf);
+ else send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "QUIT");
+ }
+
+ /* PONG */
+ void SendPong(const char *servname, const char *who)
+ {
+ if (UseTS6) send_cmd(TS6SID, "PONG %s", who);
+ else send_cmd(servname, "PONG %s", who);
+ }
+
+ /* INVITE */
+ void SendInvite(BotInfo *source, const char *chan, const char *nick)
+ {
+ if (!source || !chan || !nick) return;
+ User *u = finduser(nick);
+ send_cmd(UseTS6 ? source->uid : source->nick, "INVITE %s %s", UseTS6 ? (u ? u->uid : nick) : nick, chan);
+ }
+
+ /*
+ 1 = valid nick
+ 0 = nick is in valid
+ */
+ int IsNickValid(const char *nick)
+ {
+ /* TS6 Save extension -Certus */
+ if (isdigit(*nick)) return 0;
+ return 1;
+ }
+
+ void SendTopic(BotInfo *bi, const char *chan, const char *whosetit, const char *topic, time_t when)
+ {
+ send_cmd(UseTS6 ? bi->uid : bi->nick, "TOPIC %s :%s", chan, topic);
+ }
+} ircd_proto;
+
+
+
int anope_event_sjoin(const char *source, int ac, const char **av)
{
@@ -602,165 +891,11 @@ int anope_event_436(const char *source, int ac, const char **av)
}
-
-void RatboxProto::SendSQLine(const char *mask, const char *reason)
-{
- Uid *ud = find_uid(s_OperServ);
- send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "RESV * %s :%s", mask, reason);
-}
-
-void RatboxProto::SendSGLineDel(const char *mask)
-{
- Uid *ud = find_uid(s_OperServ);
- send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNXLINE * %s", mask);
-}
-
-void RatboxProto::SendSGLine(const char *mask, const char *reason)
-{
- Uid *ud = find_uid(s_OperServ);
- send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "XLINE * %s 0 :%s", mask, reason);
-}
-
-void RatboxProto::SendAkillDel(const char *user, const char *host)
-{
- Uid *ud = find_uid(s_OperServ);
- send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNKLINE * %s %s", user, host);
-}
-
-void RatboxProto::SendSQLineDel(const char *user)
-{
- Uid *ud = find_uid(s_OperServ);
- send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNRESV * %s", user);
-}
-
-void RatboxProto::SendJoin(BotInfo *user, const char *channel, time_t chantime)
-{
- send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel, UseTS6 ? user->uid : user->nick);
-}
-
-/*
-oper: the nick of the oper performing the kline
-target.server: the server(s) this kline is destined for
-duration: the duration if a tkline, 0 if permanent.
-user: the 'user' portion of the kline
-host: the 'host' portion of the kline
-reason: the reason for the kline.
-*/
-
-void RatboxProto::SendAkill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
-{
- Uid *ud = find_uid(s_OperServ);
- send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(expires - time(NULL)), user, host, reason);
-}
-
-void RatboxProto::SendSVSKillInternal(const char *source, const char *user, const char *buf)
-{
- if (!source || !user || !buf) return;
- Uid *ud = find_uid(source), *ud2 = find_uid(user);
- send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KILL %s :%s", UseTS6 ? (ud2 ? ud2->uid : user) : user, buf);
-}
-
-void RatboxProto::SendSVSMode(User *u, int ac, const char **av)
-{
- send_cmd(UseTS6 ? TS6SID : ServerName, "SVSMODE %s %s", u->nick, av[0]);
-}
-
-/*
- * SVINFO
- * parv[0] = sender prefix
- * parv[1] = TS_CURRENT for the server
- * parv[2] = TS_MIN for the server
- * parv[3] = server is standalone or connected to non-TS only
- * parv[4] = server's idea of UTC time
- */
-void ratbox_cmd_svinfo()
-{
- send_cmd(NULL, "SVINFO 6 3 0 :%ld", (long int) time(NULL));
-}
-
-void ratbox_cmd_svsinfo()
-{
-
-}
-
-/* CAPAB */
-/*
- QS - Can handle quit storm removal
- EX - Can do channel +e exemptions
- CHW - Can do channel wall @#
- LL - Can do lazy links
- IE - Can do invite exceptions
- EOB - Can do EOB message
- KLN - Can do KLINE message
- GLN - Can do GLINE message
- HUB - This server is a HUB
- UID - Can do UIDs
- ZIP - Can do ZIPlinks
- ENC - Can do ENCrypted links
- KNOCK - supports KNOCK
- TBURST - supports TBURST
- PARA - supports invite broadcasting for +p
- ENCAP - ?
-*/
-void ratbox_cmd_capab()
-{
- send_cmd(NULL,
- "CAPAB :QS EX CHW IE KLN GLN KNOCK TB UNKLN CLUSTER ENCAP");
-}
-
-/* PASS */
-void ratbox_cmd_pass(const char *pass)
-{
- if (UseTS6) {
- send_cmd(NULL, "PASS %s TS 6 :%s", pass, TS6SID);
- } else {
- send_cmd(NULL, "PASS %s :TS", pass);
- }
-}
-
-/* SERVER name hop descript */
-void RatboxProto::SendServer(const char *servname, int hop, const char *descript)
-{
- send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript);
-}
-
-void RatboxProto::SendConnect()
-{
- /* Make myself known to myself in the serverlist */
- if (UseTS6) me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, TS6SID);
- else me_server = new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
- if (servernum == 1) ratbox_cmd_pass(RemotePassword);
- else if (servernum == 2) ratbox_cmd_pass(RemotePassword2);
- else if (servernum == 3) ratbox_cmd_pass(RemotePassword3);
- ratbox_cmd_capab();
- SendServer(ServerName, 1, ServerDesc);
- ratbox_cmd_svinfo();
-}
-
-void RatboxProto::SendClientIntroduction(const char *nick, const char *user, const char *host, const char *real, const char *modes)
-{
- EnforceQlinedNick(nick, NULL);
- if (UseTS6) {
- char *uidbuf = ts6_uid_retrieve();
- send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0 %s :%s", nick, static_cast<long>(time(NULL)), modes, user, host, uidbuf, real);
- new_uid(nick, uidbuf);
- }
- else send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, static_cast<long>(time(NULL)), modes, user, host, ServerName, real);
- SendSQLine(nick, "Reserved for services");
-}
-
-void RatboxProto::SendPartInternal(BotInfo *nick, const char *chan, const char *buf)
-{
- Uid *ud = find_uid(nick);
- if (buf) send_cmd(UseTS6 ? ud->uid : nick->nick, "PART %s :%s", chan, buf);
- else send_cmd(UseTS6 ? ud->uid : nick->nick, "PART %s", chan);
-}
-
int anope_event_ping(const char *source, int ac, const char **av)
{
if (ac < 1)
return MOD_CONT;
- ircd_proto.SendPong(ac > 1 ? av[1] : ServerName, av[0]);
+ ircdproto->SendPong(ac > 1 ? av[1] : ServerName, av[0]);
return MOD_CONT;
}
@@ -906,86 +1041,6 @@ int anope_event_quit(const char *source, int ac, const char **av)
return MOD_CONT;
}
-void RatboxProto::SendNumericInternal(const char *source, int numeric, const char *dest, const char *buf)
-{
- // This might need to be set in the call to SendNumeric instead of here, will review later -- CyberBotX
- send_cmd(UseTS6 ? TS6SID : source, "%03d %s %s", numeric, dest, buf);
-}
-
-void RatboxProto::SendModeInternal(BotInfo *source, const char *dest, const char *buf)
-{
- if (!buf) return;
- if (source) {
- Uid *ud = find_uid(source);
- send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "MODE %s %s", dest, buf);
- }
- else send_cmd(source->nick, "MODE %s %s", dest, buf);
-}
-
-void ratbox_cmd_tmode(const char *source, const char *dest, 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);
- }
- if (!*buf) {
- return;
- }
-
- send_cmd(NULL, "MODE %s %s", dest, buf);
-}
-
-void RatboxProto::SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf)
-{
- Uid *ud = find_uid(source);
- User *u = finduser(user);
- if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "KICK %s %s :%s", chan, UseTS6 ? (u ? u->uid : user) : user, buf);
- else send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "KICK %s %s", chan, UseTS6 ? (u ? u->uid : user) : user);
-}
-
-void RatboxProto::SendNoticeChanopsInternal(BotInfo *source, const char *dest, const char *buf)
-{
- if (!buf) return;
- send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
-}
-
-void RatboxProto::SendBotOp(const char *nick, const char *chan)
-{
- if (UseTS6) {
- Uid *u = find_uid(nick);
- ratbox_cmd_tmode(nick, chan, "%s %s", ircd->botchanumode, u ? u->uid : nick);
- }
- else SendMode(findbot(nick), chan, "%s %s", ircd->botchanumode, nick);
-}
-
-/* QUIT */
-void RatboxProto::SendQuitInternal(BotInfo *source, const char *buf)
-{
- Uid *ud = find_uid(source);
- if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "QUIT :%s", buf);
- else send_cmd(UseTS6 ? (ud ? ud->uid : source->nick) : source->nick, "QUIT");
-}
-
-/* PONG */
-void RatboxProto::SendPong(const char *servname, const char *who)
-{
- if (UseTS6) send_cmd(TS6SID, "PONG %s", who);
- else send_cmd(servname, "PONG %s", who);
-}
-
-/* INVITE */
-void RatboxProto::SendInvite(BotInfo *source, const char *chan, const char *nick)
-{
- if (!source || !chan || !nick) return;
- User *u = finduser(nick);
- send_cmd(UseTS6 ? source->uid : source->nick, "INVITE %s %s", UseTS6 ? (u ? u->uid : nick) : nick, chan);
-}
-
int anope_event_mode(const char *source, int ac, const char **av)
{
User *u, *u2;
@@ -1102,16 +1157,7 @@ int anope_event_error(const char *source, int ac, const char **av)
return MOD_CONT;
}
-/*
- 1 = valid nick
- 0 = nick is in valid
-*/
-int RatboxProto::IsNickValid(const char *nick)
-{
- /* TS6 Save extension -Certus */
- if (isdigit(*nick)) return 0;
- return 1;
-}
+
/* *INDENT-OFF* */
void moduleAddIRCDMsgs(void)