mirror of
https://github.com/anope/anope.git
synced 2026-06-27 02:56:38 +02:00
Get rid of the remaining references in the core to specific services. Move more stuff out of the core to the proper modules.
This commit is contained in:
@@ -77,115 +77,6 @@ NickAlias::~NickAlias()
|
||||
NickAliasList->erase(this->nick);
|
||||
}
|
||||
|
||||
void NickAlias::Release()
|
||||
{
|
||||
if (this->HasExt("HELD"))
|
||||
{
|
||||
if (IRCD->CanSVSHold)
|
||||
IRCD->SendSVSHoldDel(this->nick);
|
||||
else
|
||||
{
|
||||
User *u = User::Find(this->nick);
|
||||
if (u && u->server == Me)
|
||||
{
|
||||
u->Quit();
|
||||
}
|
||||
}
|
||||
|
||||
this->Shrink("HELD");
|
||||
}
|
||||
}
|
||||
|
||||
/** Timers for removing HELD status from nicks.
|
||||
*/
|
||||
class NickServHeld : public Timer
|
||||
{
|
||||
static std::map<Anope::string, NickServHeld *> NickServHelds;
|
||||
|
||||
Reference<NickAlias> na;
|
||||
Anope::string nick;
|
||||
public:
|
||||
NickServHeld(NickAlias *n, long l) : Timer(l), na(n), nick(na->nick)
|
||||
{
|
||||
std::map<Anope::string, NickServHeld *>::iterator nit = NickServHelds.find(na->nick);
|
||||
if (nit != NickServHelds.end())
|
||||
delete nit->second;
|
||||
|
||||
NickServHelds[na->nick] = this;
|
||||
}
|
||||
|
||||
~NickServHeld()
|
||||
{
|
||||
NickServHelds.erase(this->nick);
|
||||
}
|
||||
|
||||
void Tick(time_t)
|
||||
{
|
||||
if (na)
|
||||
na->Shrink("HELD");
|
||||
}
|
||||
};
|
||||
std::map<Anope::string, NickServHeld *> NickServHeld::NickServHelds;
|
||||
|
||||
/** Timers for releasing nicks to be available for use
|
||||
*/
|
||||
class CoreExport NickServRelease : public User, public Timer
|
||||
{
|
||||
static std::map<Anope::string, NickServRelease *> NickServReleases;
|
||||
Anope::string nick;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
* @param na The nick
|
||||
* @param delay The delay before the nick is released
|
||||
*/
|
||||
NickServRelease(NickAlias *na, time_t delay) : User(na->nick, Config->GetBlock("options")->Get<const Anope::string>("enforceruser"),
|
||||
Config->GetBlock("options")->Get<const Anope::string>("enforcerhost"), "", "", Me, "Services Enforcer", Anope::CurTime, "", Servers::TS6_UID_Retrieve()), Timer(delay), nick(na->nick)
|
||||
{
|
||||
/* Erase the current release timer and use the new one */
|
||||
std::map<Anope::string, NickServRelease *>::iterator nit = NickServReleases.find(this->nick);
|
||||
if (nit != NickServReleases.end())
|
||||
{
|
||||
IRCD->SendQuit(nit->second, "");
|
||||
delete nit->second;
|
||||
}
|
||||
|
||||
NickServReleases.insert(std::make_pair(this->nick, this));
|
||||
|
||||
IRCD->SendClientIntroduction(this);
|
||||
}
|
||||
|
||||
virtual ~NickServRelease()
|
||||
{
|
||||
NickServReleases.erase(this->nick);
|
||||
}
|
||||
|
||||
/** Called when the delay is up
|
||||
* @param t The current time
|
||||
*/
|
||||
void Tick(time_t t)
|
||||
{
|
||||
IRCD->SendQuit(this, "");
|
||||
}
|
||||
};
|
||||
std::map<Anope::string, NickServRelease *> NickServRelease::NickServReleases;
|
||||
|
||||
void NickAlias::OnCancel(User *)
|
||||
{
|
||||
if (this->HasExt("COLLIDED"))
|
||||
{
|
||||
this->Extend("HELD");
|
||||
this->Shrink("COLLIDED");
|
||||
|
||||
new NickServHeld(this, Config->GetBlock("options")->Get<time_t>("releasetimeout"));
|
||||
|
||||
if (IRCD->CanSVSHold)
|
||||
IRCD->SendSVSHold(this->nick, Config->GetBlock("options")->Get<time_t>("releasetimeout"));
|
||||
else
|
||||
new NickServRelease(this, Config->GetBlock("options")->Get<time_t>("releasetimeout"));
|
||||
}
|
||||
}
|
||||
|
||||
void NickAlias::SetVhost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created)
|
||||
{
|
||||
this->vhost_ident = ident;
|
||||
|
||||
Reference in New Issue
Block a user