From e5051e4aa5cfc9e80ac965a6a82e4cab8d17387c Mon Sep 17 00:00:00 2001 From: "Robin Burchell w00t@inspircd.org" Date: Thu, 2 Oct 2008 16:03:16 +0000 Subject: Merge commit 'cbx/anopeng-uid' into anopeng-uid Conflicts: include/extern.h include/services.h src/protocol/bahamut.c src/protocol/inspircd11.c git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1320 5417fbe8-f217-4b02-8779-1006273d7864 --- src/protocol/bahamut.c | 169 ++++++++++----------------------------- src/protocol/bahamut.h | 2 +- src/protocol/charybdis.c | 199 ++++++++++++++++++---------------------------- src/protocol/inspircd11.c | 113 ++++++++++++++------------ src/protocol/inspircd11.h | 14 +--- src/protocol/ratbox.c | 154 ++++++++++------------------------- src/protocol/ratbox.h | 6 +- src/protocol/unreal32.c | 190 +------------------------------------------ src/protocol/unreal32.h | 2 +- 9 files changed, 228 insertions(+), 621 deletions(-) (limited to 'src/protocol') diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index c2293a38d..9cd553754 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -595,72 +595,6 @@ int anope_event_436(const char *source, int ac, const char **av) return MOD_CONT; } -/* *INDENT-OFF* */ -void moduleAddIRCDMsgs(void) { - Message *m; - - - /* first update the cs protect info about this ircd */ - updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); - - /* now add the commands */ - m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); - m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); - m = createMessage("INVITE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); - m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); - m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); - m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); - m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); - m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); - m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m); - m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); - m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m); - m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); - m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); - m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); - m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); - m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); - m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); - m = createMessage("USER", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); - m = createMessage("AKILL", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("GLOBOPS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("GNOTICE", anope_event_gnotice); addCoreMessage(IRCD,m); - m = createMessage("GOPER", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("RAKILL", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SILENCE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSKILL", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSMODE", anope_event_mode); addCoreMessage(IRCD,m); - m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSNOOP", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SQLINE", anope_event_sqline); addCoreMessage(IRCD,m); - m = createMessage("UNSQLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); - m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m); - m = createMessage("HS", anope_event_hs); addCoreMessage(IRCD,m); - m = createMessage("MS", anope_event_ms); addCoreMessage(IRCD,m); - m = createMessage("NS", anope_event_ns); addCoreMessage(IRCD,m); - m = createMessage("OS", anope_event_os); addCoreMessage(IRCD,m); - m = createMessage("RS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SGLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); - m = createMessage("SS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m); - m = createMessage("SZLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("UNSGLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("UNSZLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); - m = createMessage("LUSERSLOCK",anope_event_luserslock); addCoreMessage(IRCD,m); - m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m); - m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m); - -} - -/* *INDENT-ON* */ /* SQLINE */ void BahamutIRCdProto::SendSQLine(const char *mask, const char *reason) @@ -699,11 +633,6 @@ void BahamutIRCdProto::SendSVSNOOP(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void bahamut_cmd_svsadmin(const char *server, int set) -{ - ircd_proto.SendSVSNOOP(server, set); -} - /* SGLINE */ void BahamutIRCdProto::SendSGLine(const char *mask, const char *reason) { @@ -717,9 +646,9 @@ void BahamutIRCdProto::SendAkillDel(const char *user, const char *host) } /* TOPIC */ -void BahamutIRCdProto::cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) +void BahamutIRCdProto::SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) { - send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, static_cast(when), topic); + send_cmd(whosets->nick, "TOPIC %s %s %lu :%s", chan, whosetit, static_cast(when), topic); } /* UNSQLINE */ @@ -850,20 +779,6 @@ int anope_event_privmsg(const char *source, int ac, const char **av) return MOD_CONT; } -/* EVENT : 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 - */ -int anope_event_svinfo(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - - int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) @@ -1029,27 +944,6 @@ int anope_event_error(const char *source, int ac, const char **av) return MOD_CONT; } -int anope_event_notice(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_sqline(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - - -int anope_event_gnotice(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_pass(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - void BahamutIRCdProto::SendEOB() { send_cmd(NULL, "BURST 0"); @@ -1073,26 +967,6 @@ int anope_event_burst(const char *source, int ac, const char **av) return MOD_CONT; } -int anope_event_luserslock(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_rehash(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_credits(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_admin(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - int BahamutIRCdProto::IsFloodModeParamValid(const char *value) { char *dp, *end; @@ -1109,6 +983,45 @@ void bahamut_cmd_chghost(const char *nick, const char *vhost) } } +/* *INDENT-OFF* */ +void moduleAddIRCDMsgs(void) { + Message *m; + + + /* first update the cs protect info about this ircd */ + updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); + + /* now add the commands */ + m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); + m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); + m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); + m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); + m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); + m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); + m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); + m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); + m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); + m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); + m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); + m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); + m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); + m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); + m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); + m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); + m = createMessage("SVSMODE", anope_event_mode); addCoreMessage(IRCD,m); + m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); + m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m); + m = createMessage("HS", anope_event_hs); addCoreMessage(IRCD,m); + m = createMessage("MS", anope_event_ms); addCoreMessage(IRCD,m); + m = createMessage("NS", anope_event_ns); addCoreMessage(IRCD,m); + m = createMessage("OS", anope_event_os); addCoreMessage(IRCD,m); + m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); + m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); + m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m); +} + +/* *INDENT-ON* */ + /** * Now tell anope how to use us. **/ diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index bbc0980fa..df8166c7b 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -62,7 +62,7 @@ class BahamutIRCdProto : public IRCDProto { public: void SendSVSNOOP(const char *, int); void SendAkillDel(const char *, const char *); - void cmd_topic(const char *, const char *, const char *, const char *, time_t); + void SendTopic(BotInfo *, const char *, const char *, const char *, time_t); void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *); void SendSVSKill(const char *, const char *, const char *); void SendSVSMode(User *, int, const char **); diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 2e88e3b6d..6afb2cd07 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -438,9 +438,9 @@ void CharybdisProto::SendGlobops(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); + BotInfo *bi = findbot(source); + if (bi) { + send_cmd(UseTS6 ? bi->uid.c_str() : source, "OPERWALL :%s", buf); return; } } @@ -653,86 +653,29 @@ int anope_event_436(const char *source, int ac, const char **av) } -/* *INDENT-OFF* */ -void moduleAddIRCDMsgs(void) -{ - Message *m; - - updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); - - if (UseTS6) { - TS6SID = sstrdup(Numeric); - } - - m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); - m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); - m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m); - m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); - m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); - m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); - m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); - m = createMessage("TMODE", anope_event_tmode); addCoreMessage(IRCD,m); - m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); - m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); - m = createMessage("BMASK", anope_event_bmask); addCoreMessage(IRCD,m); - m = createMessage("UID", anope_event_nick); addCoreMessage(IRCD,m); - m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m); - m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); - m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m); - m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); - m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); - m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); - m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); - m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); - m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); - m = createMessage("TB", anope_event_tburst); addCoreMessage(IRCD,m); - m = createMessage("USER", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); - m = createMessage("SVSMODE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); - m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); - m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m); - m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m); - m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); - m = createMessage("421", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("ENCAP", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SID", anope_event_sid); addCoreMessage(IRCD,m); - m = createMessage("EUID", anope_event_euid); addCoreMessage(IRCD,m); -} - -/* *INDENT-ON* */ - void CharybdisProto::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); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "RESV * %s :%s", mask, reason); } void CharybdisProto::SendSGLineDel(const char *mask) { - Uid *ud = find_uid(s_OperServ); - send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNXLINE * %s", mask); -} - -void charybdis_cmd_svsadmin(const char *server, int set) -{ + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "UNXLINE * %s", mask); } void CharybdisProto::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); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "XLINE * %s 0 :%s", mask, reason); } void CharybdisProto::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); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "UNKLINE * %s %s", user, host); } void CharybdisProto::SendVhostDel(User *u) @@ -747,14 +690,14 @@ void CharybdisProto::SendVhost(const char *nick, const char *vIdent, const char void CharybdisProto::SendSQLineDel(const char *user) { - Uid *ud = find_uid(s_OperServ); - send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNRESV * %s", user); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "UNRESV * %s", user); } void CharybdisProto::SendJoin(const char *user, const char *channel, time_t chantime) { - Uid *ud = find_uid(user); - send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast(chantime), channel, UseTS6 ? (ud ? ud->uid : user) : user); + User *u = finduser(user); + send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast(chantime), channel, UseTS6 ? (u ? u->uid : user) : user); } /* @@ -768,15 +711,16 @@ reason: the reason for the kline. void CharybdisProto::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(expires - time(NULL)), user, host, reason); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "KLINE * %ld %s %s :%s", static_cast(expires - time(NULL)), user, host, reason); } void CharybdisProto::SendSVSKill(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); + BotInfo *bi = findbot(source); + User *u = finduser(user); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "KILL %s :%s", UseTS6 ? (u ? u->uid : user) : user, buf); } void CharybdisProto::SendSVSMode(User *u, int ac, const char **av) @@ -864,7 +808,6 @@ void CharybdisProto::SendClientIntroduction(const char *nick, const char *user, if (UseTS6) { char *uidbuf = ts6_uid_retrieve(); send_cmd(TS6SID, "UID %s 1 %ld %s %s %s 0 %s :%s", nick, static_cast(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(time(NULL)), modes, user, host, ServerName, real); SendSQLine(nick, "Reserved for services"); @@ -872,9 +815,9 @@ void CharybdisProto::SendClientIntroduction(const char *nick, const char *user, void CharybdisProto::SendPart(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); - else send_cmd(UseTS6 ? ud->uid : nick, "PART %s", chan); + User *u = finduser(nick); + if (buf) send_cmd(UseTS6 ? u->uid : nick, "PART %s :%s", chan, buf); + else send_cmd(UseTS6 ? u->uid : nick, "PART %s", chan); } int anope_event_ping(const char *source, int ac, const char **av) @@ -1044,8 +987,8 @@ void CharybdisProto::SendMode(const char *source, const char *dest, const char * { if (!buf) return; if (source) { - Uid *ud = find_uid(source); - send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "MODE %s %s", dest, buf); + BotInfo *bi = findbot(source); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "MODE %s %s", dest, buf); } else send_cmd(source, "MODE %s %s", dest, buf); } @@ -1070,23 +1013,23 @@ void charybdis_cmd_tmode(const char *source, const char *dest, const char *fmt, void CharybdisProto::SendKick(const char *source, const char *chan, const char *user, const char *buf) { - Uid *ud = find_uid(source); + BotInfo *bi = findbot(source); User *u = finduser(user); - if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KICK %s %s :%s", chan, UseTS6 ? (u ? u->uid : user) : user, buf); - else send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KICK %s %s", chan, UseTS6 ? (u ? u->uid : user) : user); + if (buf) send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "KICK %s %s :%s", chan, UseTS6 ? (u ? u->uid : user) : user, buf); + 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) { if (!buf) return; - Uid *ud = find_uid(source); - send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "NOTICE @%s :%s", dest, buf); + BotInfo *bi = findbot(source); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "NOTICE @%s :%s", dest, buf); } void CharybdisProto::SendBotOp(const char *nick, const char *chan) { if (UseTS6) { - Uid *u = find_uid(nick); + User *u = finduser(nick); charybdis_cmd_tmode(nick, chan, "%s %s", ircd->botchanumode, u ? u->uid : nick); } else anope_SendMode(ServerName, chan, "%s %s", ircd->botchanumode, nick); @@ -1095,9 +1038,9 @@ void CharybdisProto::SendBotOp(const char *nick, const char *chan) /* QUIT */ void CharybdisProto::SendQuit(const char *source, const char *buf) { - Uid *ud = find_uid(source); - if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "QUIT :%s", buf); - else send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "QUIT"); + BotInfo *bi = findbot(source); + if (buf) send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "QUIT :%s", buf); + else send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "QUIT"); } /* PONG */ @@ -1112,9 +1055,9 @@ void CharybdisProto::SendPong(const char *servname, const char *who) void CharybdisProto::SendInvite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) return; - Uid *ud = find_uid(source); + BotInfo *bi = findbot(source); User *u = finduser(nick); - send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "INVITE %s %s", UseTS6 ? (u ? u->uid : nick) : nick, chan); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "INVITE %s %s", UseTS6 ? (u ? u->uid : nick) : nick, chan); } int anope_event_mode(const char *source, int ac, const char **av) @@ -1203,20 +1146,6 @@ void CharybdisProto::SendForceNickChange(const char *oldnick, const char *newnic send_cmd(NULL, "ENCAP %s RSFNC %s %s %ld %ld", u->server->name, u->nick, newnick, static_cast(when), static_cast(u->timestamp)); } -/* - * 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 - */ -int anope_event_svinfo(const char *source, int ac, const char **av) -{ - /* currently not used but removes the message : unknown message from server */ - return MOD_CONT; -} - int anope_event_pass(const char *source, int ac, const char **av) { if (UseTS6) { @@ -1225,21 +1154,6 @@ int anope_event_pass(const char *source, int ac, const char **av) return MOD_CONT; } -int anope_event_notice(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_admin(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_invite(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - int anope_event_bmask(const char *source, int ac, const char **av) { Channel *c; @@ -1319,6 +1233,47 @@ int charybdis_send_deaccount(int argc, char **argv) return MOD_CONT; } +/* *INDENT-OFF* */ +void moduleAddIRCDMsgs(void) +{ + Message *m; + + updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); + + if (UseTS6) { + TS6SID = sstrdup(Numeric); + } + + m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); + m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); + m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); + m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); + m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); + m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); + m = createMessage("TMODE", anope_event_tmode); addCoreMessage(IRCD,m); + m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); + m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); + m = createMessage("BMASK", anope_event_bmask); addCoreMessage(IRCD,m); + m = createMessage("UID", anope_event_nick); addCoreMessage(IRCD,m); + m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); + m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m); + m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); + m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); + m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); + m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); + m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); + m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); + m = createMessage("TB", anope_event_tburst); addCoreMessage(IRCD,m); + m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); + m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); + m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); + m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); + m = createMessage("SID", anope_event_sid); addCoreMessage(IRCD,m); + m = createMessage("EUID", anope_event_euid); addCoreMessage(IRCD,m); +} + +/* *INDENT-ON* */ + /** * Now tell anope how to use us. **/ diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 904cc2459..41f5023a7 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -505,19 +505,14 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ -void inspircd_cmd_svsadmin(const char *server, int set) -{ - /* Not Supported by this IRCD */ -} - void InspIRCdProto::SendAkillDel(const char *user, const char *host) { send_cmd(s_OperServ, "GLINE %s@%s", user, host); } -void InspIRCdProto::cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) +void InspIRCdProto::SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) { - send_cmd(whosets, "FTOPIC %s %lu %s :%s", chan, static_cast(when), whosetit, topic); + send_cmd(whosets->nick, "FTOPIC %s %lu %s :%s", chan, static_cast(when), whosetit, topic); } /* CHGHOST */ @@ -577,11 +572,6 @@ void InspIRCdProto::SendMode(const char *source, const char *dest, const char *b send_cmd(source ? source : s_OperServ, "FMODE %s %u %s", dest, static_cast(c ? c->creation_time : time(NULL)), buf); } -int anope_event_version(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - int anope_event_idle(const char *source, int ac, const char **av) { if (ac == 1) { @@ -603,6 +593,27 @@ int anope_event_ftopic(const char *source, int ac, const char **av) return MOD_CONT; } +int anope_event_mode(const char *source, int ac, const char **av) +{ + if (ac < 2) + return MOD_CONT; + + if (*av[0] == '#' || *av[0] == '&') { + do_cmode(source, ac, av); + } else { + /* InspIRCd lets opers change another + users modes, we have to kludge this + as it slightly breaks RFC1459 + */ + if (!strcasecmp(source, av[0])) { + do_umode(source, ac, av); + } else { + do_umode(av[0], ac, av); + } + } + return MOD_CONT; +} + int anope_event_opertype(const char *source, int ac, const char **av) { /* opertype is equivalent to mode +o because servers @@ -916,28 +927,6 @@ int anope_event_quit(const char *source, int ac, const char **av) } -int anope_event_mode(const char *source, int ac, const char **av) -{ - if (ac < 2) - return MOD_CONT; - - if (*av[0] == '#' || *av[0] == '&') { - do_cmode(source, ac, av); - } else { - /* InspIRCd lets opers change another - users modes, we have to kludge this - as it slightly breaks RFC1459 - */ - if (!strcasecmp(source, av[0])) { - do_umode(source, ac, av); - } else { - do_umode(av[0], ac, av); - } - } - return MOD_CONT; -} - - int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) @@ -1330,22 +1319,6 @@ void InspIRCdProto::SendEOB() send_cmd(NULL, "ENDBURST"); } - -int anope_event_rehash(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_credits(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_admin(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - int InspIRCdProto::IsFloodModeParamValid(const char *value) { char *dp, *end; @@ -1353,6 +1326,46 @@ int InspIRCdProto::IsFloodModeParamValid(const char *value) else return 0; } +/* *INDENT-OFF* */ +void moduleAddIRCDMsgs(void) { + Message *m; + + updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+a","-a"); + + m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); + m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); + m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); + m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); + m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); + m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); + m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); + m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); + m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); + m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); + m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); + m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); + m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); + m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); + m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); + m = createMessage("RSQUIT", anope_event_rsquit); addCoreMessage(IRCD,m); + m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); + m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); + m = createMessage("SVSMODE", anope_event_mode) ;addCoreMessage(IRCD,m); + m = createMessage("FHOST", anope_event_chghost); addCoreMessage(IRCD,m); + m = createMessage("CHGIDENT", anope_event_chgident); addCoreMessage(IRCD,m); + m = createMessage("FNAME", anope_event_chgname); addCoreMessage(IRCD,m); + m = createMessage("SETHOST", anope_event_sethost); addCoreMessage(IRCD,m); + m = createMessage("SETIDENT", anope_event_setident); addCoreMessage(IRCD,m); + m = createMessage("SETNAME", anope_event_setname); addCoreMessage(IRCD,m); + m = createMessage("FJOIN", anope_event_fjoin); addCoreMessage(IRCD,m); + m = createMessage("FMODE", anope_event_fmode); addCoreMessage(IRCD,m); + m = createMessage("FTOPIC", anope_event_ftopic); addCoreMessage(IRCD,m); + m = createMessage("OPERTYPE", anope_event_opertype); addCoreMessage(IRCD,m); + m = createMessage("IDLE", anope_event_idle); addCoreMessage(IRCD,m); +} + +/* *INDENT-ON* */ + /** * Now tell anope how to use us. **/ diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h index e57de099e..0097d142b 100755 --- a/src/protocol/inspircd11.h +++ b/src/protocol/inspircd11.h @@ -51,22 +51,10 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -int anope_event_fjoin(const char *source, int ac, const char **av); -int anope_event_fmode(const char *source, int ac, const char **av); -int anope_event_ftopic(const char *source, int ac, const char **av); -int anope_event_sanick(const char *source, int ac, const char **av); -int anope_event_samode(const char *source, int ac, const char **av); -int anope_event_sajoin(const char *source, int ac, const char **av); -int anope_event_sapart(const char *source, int ac, const char **av); -int anope_event_version(const char *source, int ac, const char **av); -int anope_event_opertype(const char *source, int ac, const char **av); -int anope_event_idle(const char *source, int ac, const char **av); -int anope_event_rsquit(const char *source, int ac, const char **av); - class InspIRCdProto : public IRCDProto { public: void SendAkillDel(const char *, const char *); - void cmd_topic(const char *, const char *, const char *, const char *, time_t); + void SendTopic(BotInfo *, const char *, const char *, const char *, time_t); void SendVhostDel(User *); void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *); void SendSVSKill(const char *, const char *, const char *); diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index dd07cc436..d78027487 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -425,27 +425,6 @@ CUMode myCumodes[128] = { -void RatboxProto::cmd_message(const char *source, const char *dest, const char *buf) -{ - if (!buf) return; - if (NSDefFlags & NI_MSG) cmd_privmsg(source, dest, buf); - else cmd_notice(source, dest, buf); -} - -void RatboxProto::cmd_notice(const char *source, const char *dest, const char *msg) -{ - Uid *ud = find_uid(source); - User *u = finduser(dest); - send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "NOTICE %s :%s", UseTS6 ? (u ? u->uid : dest) : dest, msg); -} - -void RatboxProto::cmd_privmsg(const char *source, const char *dest, const char *buf) -{ - if (!buf) return; - Uid *ud = find_uid(source), *ud2 = find_uid(dest); - send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "PRIVMSG %s :%s", UseTS6 ? (ud2 ? ud2->uid : dest) : dest, buf); -} - void RatboxProto::SendGlobops(const char *source, const char *buf) { if (!buf) return; @@ -623,59 +602,6 @@ int anope_event_436(const char *source, int ac, const char **av) } -/* *INDENT-OFF* */ -void moduleAddIRCDMsgs(void) -{ - Message *m; - - updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); - - if (UseTS6) { - TS6SID = sstrdup(Numeric); - UseTSMODE = 1; /* TMODE */ - } - - m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); - m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); - m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m); - m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); - m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); - m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); - m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); - m = createMessage("TMODE", anope_event_tmode); addCoreMessage(IRCD,m); - m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); - m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); - m = createMessage("BMASK", anope_event_bmask); addCoreMessage(IRCD,m); - m = createMessage("UID", anope_event_nick); addCoreMessage(IRCD,m); - m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m); - m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); - m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m); - m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); - m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); - m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); - m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); - m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); - m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); - m = createMessage("TB", anope_event_tburst); addCoreMessage(IRCD,m); - m = createMessage("USER", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); - m = createMessage("SVSMODE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); - m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); - m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m); - m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m); - m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); - m = createMessage("421", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("ENCAP", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SID", anope_event_sid); addCoreMessage(IRCD,m); -} - -/* *INDENT-ON* */ - void RatboxProto::SendSQLine(const char *mask, const char *reason) { @@ -689,10 +615,6 @@ void RatboxProto::SendSGLineDel(const char *mask) send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNXLINE * %s", mask); } -void ratbox_cmd_svsadmin(const char *server, int set) -{ -} - void RatboxProto::SendSGLine(const char *mask, const char *reason) { Uid *ud = find_uid(s_OperServ); @@ -705,12 +627,6 @@ void RatboxProto::SendAkillDel(const char *user, const char *host) send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNKLINE * %s %s", user, host); } -void RatboxProto::cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) -{ - Uid *ud = find_uid(whosets); - send_cmd(UseTS6 ? (ud ? ud->uid : whosets) : whosets, "TOPIC %s :%s", chan, topic); -} - void RatboxProto::SendSQLineDel(const char *user) { Uid *ud = find_uid(s_OperServ); @@ -1137,20 +1053,6 @@ int anope_event_capab(const char *source, int ac, const char **av) return MOD_CONT; } -/* - * 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 - */ -int anope_event_svinfo(const char *source, int ac, const char **av) -{ - /* currently not used but removes the message : unknown message from server */ - return MOD_CONT; -} - int anope_event_pass(const char *source, int ac, const char **av) { if (UseTS6) { @@ -1159,21 +1061,6 @@ int anope_event_pass(const char *source, int ac, const char **av) return MOD_CONT; } -int anope_event_notice(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_admin(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_invite(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - int anope_event_bmask(const char *source, int ac, const char **av) { Channel *c; @@ -1228,6 +1115,47 @@ int RatboxProto::IsNickValid(const char *nick) return 1; } +/* *INDENT-OFF* */ +void moduleAddIRCDMsgs(void) +{ + Message *m; + + updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); + + if (UseTS6) { + TS6SID = sstrdup(Numeric); + UseTSMODE = 1; /* TMODE */ + } + + m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); + m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); + m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); + m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); + m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); + m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); + m = createMessage("TMODE", anope_event_tmode); addCoreMessage(IRCD,m); + m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); + m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); + m = createMessage("BMASK", anope_event_bmask); addCoreMessage(IRCD,m); + m = createMessage("UID", anope_event_nick); addCoreMessage(IRCD,m); + m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); + m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m); + m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); + m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); + m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); + m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); + m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); + m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); + m = createMessage("TB", anope_event_tburst); addCoreMessage(IRCD,m); + m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); + m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); + m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); + m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); + m = createMessage("SID", anope_event_sid); addCoreMessage(IRCD,m); +} + +/* *INDENT-ON* */ + /** * Now tell anope how to use us. **/ diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h index d9d87cfd7..b73485279 100644 --- a/src/protocol/ratbox.h +++ b/src/protocol/ratbox.h @@ -45,10 +45,9 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t -class RatboxProto : public IRCDProto { +class RatboxProto : public IRCDTS6Proto { public: void SendAkillDel(const char *, const char *); - void cmd_topic(const char *, const char *, const char *, const char *, time_t); void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *); void SendSVSKill(const char *, const char *, const char *); void SendSVSMode(User *, int, const char **); @@ -56,9 +55,6 @@ class RatboxProto : public IRCDProto { void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *); void SendKick(const char *, const char *, const char *, const char *); void SendNoticeChanops(const char *, const char *, const char *); - void cmd_message(const char *, const char *, const char *); - void cmd_notice(const char *, const char *, const char *); - void cmd_privmsg(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 5fb0548d3..0d9789862 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -483,19 +483,14 @@ void UnrealIRCdProto::SendSVSNOOP(const char *server, int set) send_cmd(NULL, "%s %s %s", send_token("SVSNOOP", "f"), server, set ? "+" : "-"); } -void unreal_cmd_svsadmin(const char *server, int set) -{ - ircd_proto.SendSVSNOOP(server, set); -} - void UnrealIRCdProto::SendAkillDel(const char *user, const char *host) { send_cmd(NULL, "%s - G %s %s %s", send_token("TKL", "BD"), user, host, s_OperServ); } -void UnrealIRCdProto::cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) +void UnrealIRCdProto::SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) { - send_cmd(whosets, "%s %s %s %lu :%s", send_token("TOPIC", ")"), chan, whosetit, static_cast(when), topic); + send_cmd(whosets->nick, "%s %s %s %lu :%s", send_token("TOPIC", ")"), chan, whosetit, static_cast(when), topic); } void UnrealIRCdProto::SendVhostDel(User *u) @@ -753,26 +748,6 @@ int anope_event_netinfo(const char *source, int ac, const char **av) return MOD_CONT; } - -/* TKL - * add: remove: spamfilter: spamfilter+TKLEXT sqline: - * parv[ 1]: + - +/- + +/- - * parv[ 2]: type type type type type - * parv[ 3]: user user target target hold - * parv[ 4]: host host action action host - * parv[ 5]: setby removedby (un)setby setby setby - * parv[ 6]: expire_at expire_at (0) expire_at (0) expire_at - * parv[ 7]: set_at set_at set_at set_at - * parv[ 8]: reason regex tkl duration reason - * parv[ 9]: tkl reason [A] - * parv[10]: regex - * -*/ -int anope_event_tkl(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - int anope_event_eos(const char *source, int ac, const char **av) { Server *s; @@ -846,12 +821,6 @@ int anope_event_quit(const char *source, int ac, const char **av) return MOD_CONT; } -int anope_event_pass(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - - int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) @@ -1244,16 +1213,6 @@ int anope_event_error(const char *source, int ac, const char **av) return MOD_CONT; } -int anope_event_notice(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_smo(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - /* svsjoin parv[0] - sender parv[1] - nick to make join @@ -1279,31 +1238,6 @@ void UnrealIRCdProto::SendSVSPart(const char *source, const char *nick, const ch send_cmd(source, "%s %s :%s", send_token("SVSPART", "BT"), nick, chan); } -int anope_event_globops(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_swhois(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_rehash(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_credits(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_admin(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - int anope_event_sdesc(const char *source, int ac, const char **av) { Server *s; @@ -1396,19 +1330,11 @@ void moduleAddIRCDMsgs(void) { updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+a","-a"); - m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m); m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); - m = createMessage("451", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("461", anope_event_null); addCoreMessage(IRCD,m); m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("6", anope_event_away); addCoreMessage(IRCD,m); } - m = createMessage("INVITE", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("*", anope_event_null); addCoreMessage(IRCD,m); - } m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("C", anope_event_join); addCoreMessage(IRCD,m); @@ -1433,10 +1359,6 @@ void moduleAddIRCDMsgs(void) { if (UseTokens) { m = createMessage("&", anope_event_nick); addCoreMessage(IRCD,m); } - m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("B", anope_event_notice); addCoreMessage(IRCD,m); - } m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("D", anope_event_part); addCoreMessage(IRCD,m); @@ -1473,62 +1395,10 @@ void moduleAddIRCDMsgs(void) { if (UseTokens) { m = createMessage("v", anope_event_mode); addCoreMessage(IRCD,m); } - m = createMessage("USER", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("%", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("=", anope_event_null); addCoreMessage(IRCD,m); - } m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("#", anope_event_whois); addCoreMessage(IRCD,m); } - m = createMessage("AKILL", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("V", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("GLOBOPS", anope_event_globops); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("]", anope_event_globops); addCoreMessage(IRCD,m); - } - m = createMessage("GNOTICE", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("Z", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("GOPER", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("[", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("RAKILL", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("Y", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("SILENCE", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("U", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("SVSKILL", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("h", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("e", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("SVSNOOP", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("f", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("SQLINE", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("c", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("UNSQLINE", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("d", anope_event_null); addCoreMessage(IRCD,m); - } m = createMessage("PROTOCTL", anope_event_capab); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("_", anope_event_capab); addCoreMessage(IRCD,m); @@ -1561,82 +1431,26 @@ void moduleAddIRCDMsgs(void) { if (UseTokens) { m = createMessage("AE", anope_event_setname); addCoreMessage(IRCD,m); } - m = createMessage("TKL", anope_event_tkl); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("BD", anope_event_tkl); addCoreMessage(IRCD,m); - } m = createMessage("EOS", anope_event_eos); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("ES", anope_event_eos); addCoreMessage(IRCD,m); } - m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("<", anope_event_pass); addCoreMessage(IRCD,m); - } m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("5", anope_event_error); addCoreMessage(IRCD,m); } - m = createMessage("SMO", anope_event_smo); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("AU", anope_event_smo); addCoreMessage(IRCD,m); - } m = createMessage("UMODE2", anope_event_umode2); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("|", anope_event_umode2); addCoreMessage(IRCD,m); } - m = createMessage("SWHOIS", anope_event_swhois); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("BA", anope_event_swhois); addCoreMessage(IRCD,m); - } m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("~", anope_event_sjoin); addCoreMessage(IRCD,m); } - m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("O", anope_event_rehash); addCoreMessage(IRCD,m); - } - m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("@", anope_event_admin); addCoreMessage(IRCD,m); - } - m = createMessage("CREDITS", anope_event_credits); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("AJ", anope_event_credits); addCoreMessage(IRCD,m); - } m = createMessage("SDESC", anope_event_sdesc); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("AG", anope_event_sdesc); addCoreMessage(IRCD,m); } - m = createMessage("HTM", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("BH", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("HELP", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("4", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("TRACE", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("b", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("LAG", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("AF", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("RPING", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("AM", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("SENDSNO", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("Ss", anope_event_null); addCoreMessage(IRCD,m); - } - m = createMessage("SENDUMODE", anope_event_null); addCoreMessage(IRCD,m); - if (UseTokens) { - m = createMessage("AP", anope_event_null); addCoreMessage(IRCD,m); - } /* The none token version of these is in messages.c */ if (UseTokens) { diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h index c5ed93ca4..b25a810e6 100644 --- a/src/protocol/unreal32.h +++ b/src/protocol/unreal32.h @@ -84,7 +84,7 @@ class UnrealIRCdProto : public IRCDProto { public: void SendSVSNOOP(const char *, int); void SendAkillDel(const char *, const char *); - void cmd_topic(const char *, const char *, const char *, const char *, time_t); + void SendTopic(BotInfo *, const char *, const char *, const char *, time_t); void SendVhostDel(User *); void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *); void SendSVSKill(const char *, const char *, const char *); -- cgit