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/core/ns_recover.cpp | |
parent | 1782ce260c5bc214ec0b2e39257ab1371b68ae9c (diff) |
Moved the core pseudo clients out into their own modules
Diffstat (limited to 'modules/core/ns_recover.cpp')
-rw-r--r-- | modules/core/ns_recover.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/core/ns_recover.cpp b/modules/core/ns_recover.cpp index f9e088586..30e1476c3 100644 --- a/modules/core/ns_recover.cpp +++ b/modules/core/ns_recover.cpp @@ -12,6 +12,7 @@ /*************************************************************************/ #include "module.h" +#include "nickserv.h" class CommandNSRecover : public Command { @@ -50,7 +51,7 @@ class CommandNSRecover : public Command if (MOD_RESULT == EVENT_ALLOW) { - u2->SendMessage(NickServ, _(FORCENICKCHANGE_NOW)); + u2->SendMessage(nickserv->Bot(), _(FORCENICKCHANGE_NOW)); u2->Collide(na); /* Convert Config->NSReleaseTimeout seconds to string format */ @@ -70,7 +71,7 @@ class CommandNSRecover : public Command if (u->Account() == na->nc || (!na->nc->HasFlag(NI_SECURE) && is_on_access(u, na->nc)) || (!u->fingerprint.empty() && na->nc->FindCert(u->fingerprint))) { - u2->SendMessage(NickServ, _(FORCENICKCHANGE_NOW)); + u2->SendMessage(nickserv->Bot(), _(FORCENICKCHANGE_NOW)); u2->Collide(na); /* Convert Config->NSReleaseTimeout seconds to string format */ @@ -110,7 +111,7 @@ class CommandNSRecover : public Command "current address as shown in /WHOIS must be on that nick's\n" "access list, you must be identified and in the group of\n" "that nick, or you must supply the correct password for\n" - "the nickname."), NickServ->nick.c_str(), NickServ->nick.c_str(), relstr.c_str(), Config->UseStrictPrivMsgString.c_str(), NickServ->nick.c_str()); + "the nickname."), Config->s_NickServ.c_str(), Config->s_NickServ.c_str(), relstr.c_str(), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str()); return true; } @@ -131,7 +132,10 @@ class NSRecover : public Module this->SetAuthor("Anope"); this->SetType(CORE); - this->AddCommand(NickServ, &commandnsrecover); + if (!nickserv) + throw ModuleException("NickServ is not loaded!"); + + this->AddCommand(nickserv->Bot(), &commandnsrecover); } }; |