From d33a0f75a5c0c584fbb7cc0076da36d494f39494 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 22 Nov 2012 00:50:33 -0500 Subject: Pretty large coding style cleanup, in source doc cleanup, and allow protocol mods to depend on each other --- modules/extra/m_sql_authentication.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'modules/extra/m_sql_authentication.cpp') diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index 9412edc50..ce7a275b3 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -5,7 +5,7 @@ static Module *me; class SQLAuthenticationResult : public SQLInterface { - dynamic_reference user; + Reference user; IdentifyRequest *req; public: @@ -37,26 +37,25 @@ class SQLAuthenticationResult : public SQLInterface } catch (const SQLException &) { } - const BotInfo *bi = findbot(Config->NickServ); - NickAlias *na = findnick(req->GetAccount()); + NickAlias *na = NickAlias::Find(req->GetAccount()); if (na == NULL) { na = new NickAlias(req->GetAccount(), new NickCore(req->GetAccount())); if (user) { if (Config->NSAddAccessOnReg) - na->nc->AddAccess(create_mask(user)); + na->nc->AddAccess(user->Mask()); - if (bi) - user->SendMessage(bi, _("Your account \002%s\002 has been successfully created."), na->nick.c_str()); + if (NickServ) + user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->nick.c_str()); } } if (!email.empty() && email != na->nc->email) { na->nc->email = email; - if (user && bi) - user->SendMessage(bi, _("Your email has been updated to \002%s\002."), email.c_str()); + if (user && NickServ) + user->SendMessage(NickServ, _("Your email has been updated to \002%s\002."), email.c_str()); } req->Success(me); @@ -77,7 +76,7 @@ class ModuleSQLAuthentication : public Module bool disable_register; Anope::string disable_reason; - service_reference SQL; + ServiceReference SQL; public: ModuleSQLAuthentication(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, SUPPORTED) @@ -101,7 +100,7 @@ class ModuleSQLAuthentication : public Module this->disable_register = config.ReadFlag("m_sql_authentication", "disable_ns_register", "false", 0); this->disable_reason = config.ReadValue("m_sql_authentication", "disable_reason", "", 0); - this->SQL = service_reference("SQLProvider", this->engine); + this->SQL = ServiceReference("SQLProvider", this->engine); } EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector ¶ms) anope_override -- cgit