From 4fcbbbe4fbc137841b47c8e2372477b85649270a Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 17 Dec 2016 21:44:22 -0500 Subject: Split ircdproto send functions out into separate services This makes it easier to see which send functions a protocol module implements as they are all explicitly registered by the module, and avoids the problem of subtly breaking other protocol modules when using inheritance. Also split the old "core" send implementations out into a module, and the TS6 ID generator --- modules/operserv/jupe.cpp | 4 ++-- modules/operserv/main/operserv.cpp | 12 ++++++------ modules/operserv/noop.cpp | 4 ++-- modules/operserv/svs.cpp | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'modules/operserv') diff --git a/modules/operserv/jupe.cpp b/modules/operserv/jupe.cpp index 2f9386eda..882effa4f 100644 --- a/modules/operserv/jupe.cpp +++ b/modules/operserv/jupe.cpp @@ -57,11 +57,11 @@ class CommandOSJupe : public Command Anope::string sid = IRCD->SID_Retrieve(); if (server) { - IRCD->SendSquit(server, rbuf); + IRCD->Send(server, rbuf); server->Delete(rbuf); } Server *juped_server = new Server(Me, jserver, 1, rbuf, sid, true); - IRCD->SendServer(juped_server); + IRCD->Send(juped_server); Log(LOG_ADMIN, source, this) << "on " << jserver << " (" << rbuf << ")"; } diff --git a/modules/operserv/main/operserv.cpp b/modules/operserv/main/operserv.cpp index 09dc3bbac..fc8dbf423 100644 --- a/modules/operserv/main/operserv.cpp +++ b/modules/operserv/main/operserv.cpp @@ -38,12 +38,12 @@ class SGLineManager : public XLineManager void Send(User *u, XLine *x) override { - IRCD->SendAkill(u, x); + IRCD->Send(u, x); } void SendDel(XLine *x) override { - IRCD->SendAkillDel(x); + IRCD->Send(x); } bool Check(User *u, XLine *x) override @@ -106,7 +106,7 @@ class SQLineManager : public XLineManager } else if (x->GetMask()[0] != '#' || IRCD->CanSQLineChannel) { - IRCD->SendSQLine(u, x); + IRCD->Send(u, x); /* If it is an oper, assume they're walking it, otherwise kill for good measure */ if (u && !u->HasMode("OPER")) u->Kill(Config->GetClient("OperServ"), "Q-Lined: " + x->GetReason()); @@ -118,7 +118,7 @@ class SQLineManager : public XLineManager if (!IRCD->CanSQLine || x->IsRegex()) ; else if (x->GetMask()[0] != '#' || IRCD->CanSQLineChannel) - IRCD->SendSQLineDel(x); + IRCD->Send(x); } bool Check(User *u, XLine *x) override @@ -168,7 +168,7 @@ class SNLineManager : public XLineManager void Send(User *u, XLine *x) override { if (IRCD->CanSNLine && !x->IsRegex()) - IRCD->SendSGLine(u, x); + IRCD->Send(u, x); if (u) u->Kill(Config->GetClient("OperServ"), "SNLined: " + x->GetReason()); @@ -177,7 +177,7 @@ class SNLineManager : public XLineManager void SendDel(XLine *x) override { if (IRCD->CanSNLine && !x->IsRegex()) - IRCD->SendSGLineDel(x); + IRCD->Send(x); } bool Check(User *u, XLine *x) override diff --git a/modules/operserv/noop.cpp b/modules/operserv/noop.cpp index 2d813a0cc..329a6c338 100644 --- a/modules/operserv/noop.cpp +++ b/modules/operserv/noop.cpp @@ -50,7 +50,7 @@ class CommandOSNOOP : public Command if (cmd.equals_ci("SET")) { /* Remove the O:lines */ - IRCD->SendSVSNOOP(s, true); + IRCD->Send(s, true); s->Extend("noop", source.GetNick()); Log(LOG_ADMIN, source, this) << "SET on " << s->GetName(); @@ -69,7 +69,7 @@ class CommandOSNOOP : public Command else if (cmd.equals_ci("REVOKE")) { s->Shrink("noop"); - IRCD->SendSVSNOOP(s, false); + IRCD->Send(s, false); Log(LOG_ADMIN, source, this) << "REVOKE on " << s->GetName(); source.Reply(_("All O:lines of \002{0}\002 have been reset."), s->GetName()); } diff --git a/modules/operserv/svs.cpp b/modules/operserv/svs.cpp index 81138740f..ccba9d8d1 100644 --- a/modules/operserv/svs.cpp +++ b/modules/operserv/svs.cpp @@ -69,7 +69,7 @@ class CommandOSSVSNick : public Command source.Reply(_("\002{0}\002 is now being changed to \002{1}\002."), nick, newnick); Log(LOG_ADMIN, source, this) << "to change " << nick << " to " << newnick; - IRCD->SendForceNickChange(u2, newnick, Anope::CurTime); + IRCD->Send(u2, newnick, Anope::CurTime); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override @@ -122,7 +122,7 @@ class CommandOSSVSJoin : public Command return; } - IRCD->SendSVSJoin(*source.service, target, params[1], ""); + IRCD->Send(*source.service, target, params[1], ""); Log(LOG_ADMIN, source, this) << "to force " << target->nick << " to join " << params[1]; source.Reply(_("\002{0}\002 has been joined to \002{1}\002."), target->nick, params[1]); } @@ -178,7 +178,7 @@ class CommandOSSVSPart : public Command } const Anope::string &reason = params.size() > 2 ? params[2] : ""; - IRCD->SendSVSPart(*source.service, target, params[1], reason); + IRCD->Send(*source.service, target, params[1], reason); if (!reason.empty()) Log(LOG_ADMIN, source, this) << "to force " << target->nick << " to part " << c->name << " with reason " << reason; else -- cgit