From 1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 May 2013 01:55:04 -0400 Subject: Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in. --- modules/commands/ns_recover.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'modules/commands/ns_recover.cpp') diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index 669d26da9..845c98915 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -13,6 +13,11 @@ #include "module.h" +namespace +{ + bool restoreonrecover; +} + struct NSRecoverExtensibleInfo : ExtensibleItem, std::map { }; class NSRecoverRequest : public IdentifyRequest @@ -56,7 +61,7 @@ class NSRecoverRequest : public IdentifyRequest Log(LOG_COMMAND, source, cmd) << "and was automatically identified to " << u->Account()->display; } - if (Config->NSRestoreOnRecover) + if (restoreonrecover) { if (!u->chans.empty()) { @@ -205,7 +210,7 @@ class NSRecover : public Module commandnsrecover(this) { - if (Config->NoNicknameOwnership) + if (Config->GetBlock("options")->Get("nonicknameownership")) throw ModuleException(modname + " can not be used with options:nonicknameownership enabled"); Implementation i[] = { I_OnUserNickChange, I_OnJoinChannel, I_OnShutdown, I_OnRestart }; @@ -233,7 +238,7 @@ class NSRecover : public Module void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override { - if (Config->NSRestoreOnRecover) + if (Config->GetModule(this)->Get("restoreonrecover")) { NSRecoverExtensibleInfo *ei = u->GetExt("ns_recover_info"); @@ -255,7 +260,7 @@ class NSRecover : public Module void OnJoinChannel(User *u, Channel *c) anope_override { - if (Config->NSRestoreOnRecover) + if (Config->GetModule(this)->Get("restoreonrecover")) { NSRecoverExtensibleInfo *ei = u->GetExt("ns_recover_info"); -- cgit