1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 21:43:13 +02:00

Moved the core pseudo clients out into their own modules

This commit is contained in:
Adam
2011-04-22 03:16:11 -04:00
parent 1782ce260c
commit c8c23158a4
226 changed files with 5187 additions and 4891 deletions
+21 -17
View File
@@ -13,6 +13,7 @@
#include "services.h"
#include "modules.h"
#include "nickserv.h"
/* inspircd-ts6.h uses these */
static bool has_globopsmod = false;
@@ -57,11 +58,12 @@ void inspircd_cmd_chghost(const Anope::string &nick, const Anope::string &vhost)
{
if (!has_chghostmod)
{
ircdproto->SendGlobops(OperServ, "CHGHOST not loaded!");
Log() << "CHGHOST not loaded!";
return;
}
send_cmd(HostServ ? HostServ->GetUID() : Config->Numeric, "CHGHOST %s %s", nick.c_str(), vhost.c_str());
User *u = finduser(nick);
send_cmd(u ? u->GetUID() : Config->Numeric, "CHGHOST %s %s", nick.c_str(), vhost.c_str());
}
bool event_idle(const Anope::string &source, const std::vector<Anope::string> &params)
@@ -260,13 +262,14 @@ bool event_metadata(const Anope::string &source, const std::vector<Anope::string
else if (params[1].equals_cs("accountname"))
{
User *u = finduser(params[0]);
NickAlias *user_na = u ? findnick(u->nick) : NULL;
NickCore *nc = findcore(params[2]);
if (u && nc)
{
u->Login(nc);
if (user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
u->SetMode(NickServ, UMODE_REGISTERED);
NickAlias *user_na = findnick(u->nick);
if (nickserv && user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false)
u->SetMode(nickserv->Bot(), UMODE_REGISTERED);
}
}
@@ -383,8 +386,8 @@ class Inspircd12IRCdMessage : public InspircdIRCdMessage
for (unsigned i = 9; i < params.size() - 1; ++i)
modes += " " + params[i];
User *user = do_nick("", params[2], params[5], params[3], source, params[params.size() - 1], ts, params[6], params[4], params[0], modes);
if (user && user->server->IsSynced())
validate_user(user);
if (user && user->server->IsSynced() && nickserv)
nickserv->Validate(user);
return true;
}
@@ -709,11 +712,11 @@ class Inspircd12IRCdMessage : public InspircdIRCdMessage
return false;
}
if (!has_svsholdmod)
ircdproto->SendGlobops(OperServ, "SVSHOLD missing, Usage disabled until module is loaded.");
Log() << "SVSHOLD missing, Usage disabled until module is loaded.";
if (!has_chghostmod)
ircdproto->SendGlobops(OperServ, "CHGHOST missing, Usage disabled until module is loaded.");
Log() << "CHGHOST missing, Usage disabled until module is loaded.";
if (!has_chgidentmod)
ircdproto->SendGlobops(OperServ, "CHGIDENT missing, Usage disabled until module is loaded.");
Log() << "CHGIDENT missing, Usage disabled until module is loaded.";
ircd->svshold = has_svsholdmod;
}
@@ -763,17 +766,18 @@ class ProtoInspIRCd : public Module
/* InspIRCd 1.2 doesn't set -r on nick change, remove -r here. Note that if we have to set +r later
* this will cancel out this -r, resulting in no mode changes.
*/
u->RemoveMode(NickServ, UMODE_REGISTERED);
u->RemoveMode(nickserv->Bot(), UMODE_REGISTERED);
}
void OnServerSync(Server *s)
{
for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
{
User *u = it->second;
if (u->server == s && !u->IsIdentified())
validate_user(u);
}
if (nickserv)
for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
{
User *u = it->second;
if (u->server == s && !u->IsIdentified())
nickserv->Validate(u);
}
}
};