diff options
| author | Adam <Adam@anope.org> | 2011-04-22 03:16:11 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-05-16 04:06:17 -0400 |
| commit | c8c23158a4ff74822d6c7d201dc53d879e3d91e8 (patch) | |
| tree | 4bc9ae029691d5e7c03ebc1481683a010b733844 /modules/protocol/inspircd12.cpp | |
| parent | 1782ce260c5bc214ec0b2e39257ab1371b68ae9c (diff) | |
Moved the core pseudo clients out into their own modules
Diffstat (limited to 'modules/protocol/inspircd12.cpp')
| -rw-r--r-- | modules/protocol/inspircd12.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 82d43434c..4723a21af 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -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> ¶ms) @@ -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); + } } }; |
