diff options
| author | Adam <Adam@anope.org> | 2016-12-17 21:44:22 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2016-12-17 21:44:22 -0500 |
| commit | 4fcbbbe4fbc137841b47c8e2372477b85649270a (patch) | |
| tree | f2a5fd3b5a77ef0384df6e2712fdd74f832d7dfe /modules/nickserv | |
| parent | ed08d1a31119adb379f8bec46d7ad47ee35c4c92 (diff) | |
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
Diffstat (limited to 'modules/nickserv')
| -rw-r--r-- | modules/nickserv/ajoin.cpp | 6 | ||||
| -rw-r--r-- | modules/nickserv/logout.cpp | 2 | ||||
| -rw-r--r-- | modules/nickserv/main/nickserv.cpp | 14 | ||||
| -rw-r--r-- | modules/nickserv/recover.cpp | 6 | ||||
| -rw-r--r-- | modules/nickserv/register.cpp | 4 | ||||
| -rw-r--r-- | modules/nickserv/set.cpp | 2 |
6 files changed, 17 insertions, 17 deletions
diff --git a/modules/nickserv/ajoin.cpp b/modules/nickserv/ajoin.cpp index 5973c95ac..0d708143c 100644 --- a/modules/nickserv/ajoin.cpp +++ b/modules/nickserv/ajoin.cpp @@ -371,7 +371,7 @@ class NSAJoin : public Module { try { - unsigned limit = convertTo<unsigned>(l); + unsigned int limit = convertTo<unsigned int>(l); if (c->users.size() >= limit) need_invite = true; } @@ -384,10 +384,10 @@ class NSAJoin : public Module { if (!u_access.HasPriv("INVITE")) continue; - IRCD->SendInvite(NickServ, c, u); + IRCD->Send<messages::Invite>(NickServ, c, u); } - IRCD->SendSVSJoin(NickServ, u, entry->GetChannel(), key); + IRCD->Send<messages::SVSJoin>(NickServ, u, entry->GetChannel(), key); } } }; diff --git a/modules/nickserv/logout.cpp b/modules/nickserv/logout.cpp index 6a9d119ad..0e6cdb46a 100644 --- a/modules/nickserv/logout.cpp +++ b/modules/nickserv/logout.cpp @@ -68,7 +68,7 @@ class CommandNSLogout : public Command else source.Reply(_("You have been logged out.")); - IRCD->SendLogout(u2); + IRCD->Send<messages::Logout>(u2); u2->RemoveMode(source.service, "REGISTERED"); u2->Logout(); diff --git a/modules/nickserv/main/nickserv.cpp b/modules/nickserv/main/nickserv.cpp index 60b136db1..3741d119b 100644 --- a/modules/nickserv/main/nickserv.cpp +++ b/modules/nickserv/main/nickserv.cpp @@ -115,7 +115,7 @@ class NickServRelease : public User, public Timer NickServReleases.insert(std::make_pair(this->nick, this)); - IRCD->SendClientIntroduction(this); + IRCD->Send<messages::NickIntroduction>(this); } ~NickServRelease() @@ -168,7 +168,7 @@ class NickServCore : public Module, public NickServ::NickServService new NickServHeld(this, na, Config->GetModule("nickserv/main")->Get<time_t>("releasetimeout", "1m")); if (IRCD->CanSVSHold) - IRCD->SendSVSHold(na->GetNick(), Config->GetModule("nickserv/main")->Get<time_t>("releasetimeout", "1m")); + IRCD->Send<messages::SVSHold>(na->GetNick(), Config->GetModule("nickserv/main")->Get<time_t>("releasetimeout", "1m")); else new NickServRelease(this, na, Config->GetModule("nickserv/main")->Get<time_t>("releasetimeout", "1m")); } @@ -324,7 +324,7 @@ class NickServCore : public Module, public NickServ::NickServService else { u->SendMessage(*NickServ, _("Your nickname is now being changed to \002%s\002"), guestnick.c_str()); - IRCD->SendForceNickChange(u, guestnick, Anope::CurTime); + IRCD->Send<messages::SVSNick>(u, guestnick, Anope::CurTime); } } else @@ -338,7 +338,7 @@ class NickServCore : public Module, public NickServ::NickServService if (held.HasExt(na)) { if (IRCD->CanSVSHold) - IRCD->SendSVSHoldDel(na->GetNick()); + IRCD->Send<messages::SVSHoldDel>(na->GetNick()); else { User *u = User::Find(na->GetNick(), true); @@ -418,7 +418,7 @@ class NickServCore : public Module, public NickServ::NickServService User *u = User::Find(na->GetNick(), true); if (u && u->Account() == na->GetAccount()) { - IRCD->SendLogout(u); + IRCD->Send<messages::Logout>(u); u->RemoveMode(NickServ, "REGISTERED"); u->Logout(); } @@ -432,7 +432,7 @@ class NickServCore : public Module, public NickServ::NickServService for (unsigned int i = nc->users.size(); i > 0; --i) { User *user = nc->users[i - 1]; - IRCD->SendLogout(user); + IRCD->Send<messages::Logout>(user); user->RemoveMode(NickServ, "REGISTERED"); user->Logout(); EventManager::Get()->Dispatch(&Event::NickLogout::OnNickLogout, user); @@ -552,7 +552,7 @@ class NickServCore : public Module, public NickServ::NickServService else { /* Reset +r and re-send account (even though it really should be set at this point) */ - IRCD->SendLogin(u, na); + IRCD->Send<messages::Login>(u, na); if (!Config->GetModule("nickserv/main")->Get<bool>("nonicknameownership") && na->GetAccount() == u->Account() && !na->GetAccount()->IsUnconfirmed()) u->SetMode(NickServ, "REGISTERED"); Log(u, "", NickServ) << u->GetMask() << " automatically identified for group " << u->Account()->GetDisplay(); diff --git a/modules/nickserv/recover.cpp b/modules/nickserv/recover.cpp index f3fa24bb6..60a0bee2f 100644 --- a/modules/nickserv/recover.cpp +++ b/modules/nickserv/recover.cpp @@ -92,7 +92,7 @@ class NSRecoverRequestListener : public NickServ::IdentifyRequestListener source.Reply(_("Ghost with your nick has been killed.")); if (IRCD->CanSVSNick) - IRCD->SendForceNickChange(source.GetUser(), user, Anope::CurTime); + IRCD->Send<messages::SVSNick>(source.GetUser(), user, Anope::CurTime); } /* User is not identified or not identified to the same account as the person using this command */ else @@ -266,7 +266,7 @@ class NSRecover : public Module if (u->FindChannel(c)) this->OnJoinChannel(u, c); else if (IRCD->CanSVSJoin) - IRCD->SendSVSJoin(NickServ, u, cname, ""); + IRCD->Send<messages::SVSJoin>(NickServ, u, cname, ""); } } @@ -276,7 +276,7 @@ class NSRecover : public Module if (svs->from) { // svsnick from to to - IRCD->SendForceNickChange(svs->from, svs->to, Anope::CurTime); + IRCD->Send<messages::SVSNick>(svs->from, svs->to, Anope::CurTime); } svsnick.Unset(u); diff --git a/modules/nickserv/register.cpp b/modules/nickserv/register.cpp index 4ceb3f113..b06e08075 100644 --- a/modules/nickserv/register.cpp +++ b/modules/nickserv/register.cpp @@ -59,7 +59,7 @@ class CommandNSConfirm : public Command /* Login the users online already */ for (User *u : na->GetAccount()->users) { - IRCD->SendLogin(u, na); + IRCD->Send<messages::Login>(u, na); NickServ::Nick *u_na = NickServ::FindNick(u->nick); @@ -90,7 +90,7 @@ class CommandNSConfirm : public Command NickServ::Nick *na = NickServ::FindNick(source.GetNick()); if (na) { - IRCD->SendLogin(source.GetUser(), na); + IRCD->Send<messages::Login>(source.GetUser(), na); if (!Config->GetModule("nickserv/main")->Get<bool>("nonicknameownership") && na->GetAccount() == source.GetAccount() && !na->GetAccount()->IsUnconfirmed()) source.GetUser()->SetMode(source.service, "REGISTERED"); } diff --git a/modules/nickserv/set.cpp b/modules/nickserv/set.cpp index 136d43be8..c7d03f8d2 100644 --- a/modules/nickserv/set.cpp +++ b/modules/nickserv/set.cpp @@ -362,7 +362,7 @@ class CommandNSSetDisplay : public Command for (User *u : user_na->GetAccount()->users) { - IRCD->SendLogin(u, user_na); + IRCD->Send<messages::Login>(u, user_na); } source.Reply(_("The new display is now \002{0}\002."), user_na->GetAccount()->GetDisplay()); |
