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/cs_entrymsg.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'modules/commands/cs_entrymsg.cpp') diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 961cf1895..da764d81c 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -39,8 +39,6 @@ struct EntryMsg : Serializable static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; -static unsigned MaxEntries = 0; - struct EntryMessageList : Serialize::Checker >, ExtensibleItem { EntryMessageList() : Serialize::Checker >("EntryMsg") { } @@ -140,7 +138,7 @@ class CommandEntryMessage : public Command ci->Extend("cs_entrymsg", messages); } - if (MaxEntries && (*messages)->size() >= MaxEntries) + if ((*messages)->size() >= Config->GetModule(this->owner)->Get("maxentries")) source.Reply(_("The entry message list for \002%s\002 is full."), ci->name.c_str()); else { @@ -276,7 +274,7 @@ class CSEntryMessage : public Module CSEntryMessage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), entrymsg_type("EntryMsg", EntryMsg::Unserialize), commandentrymsg(this) { - Implementation i[] = { I_OnReload, I_OnJoinChannel }; + Implementation i[] = { I_OnJoinChannel }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } @@ -291,11 +289,6 @@ class CSEntryMessage : public Module u->SendMessage(c->ci->WhoSends(), "[%s] %s", c->ci->name.c_str(), (*messages)->at(i)->message.c_str()); } } - - void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override - { - MaxEntries = reader.ReadInteger("cs_entrymsg", "maxentries", "5", 0, true); - } }; MODULE_INIT(CSEntryMessage) -- cgit