summaryrefslogtreecommitdiff
path: root/modules/commands/cs_entrymsg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_entrymsg.cpp')
-rw-r--r--modules/commands/cs_entrymsg.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp
index 68c36e7c7..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<std::vector<EntryMsg *> >, ExtensibleItem
{
EntryMessageList() : Serialize::Checker<std::vector<EntryMsg *> >("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<unsigned>("maxentries"))
source.Reply(_("The entry message list for \002%s\002 is full."), ci->name.c_str());
else
{
@@ -273,14 +271,11 @@ class CSEntryMessage : public Module
CommandEntryMessage commandentrymsg;
public:
- CSEntryMessage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE), entrymsg_type("EntryMsg", EntryMsg::Unserialize), commandentrymsg(this)
+ CSEntryMessage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), entrymsg_type("EntryMsg", EntryMsg::Unserialize), commandentrymsg(this)
{
- this->SetAuthor("Anope");
- Implementation i[] = { I_OnReload, I_OnJoinChannel };
+ Implementation i[] = { I_OnJoinChannel };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
-
- this->OnReload();
}
void OnJoinChannel(User *u, Channel *c) anope_override
@@ -294,12 +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() anope_override
- {
- ConfigReader config;
- MaxEntries = config.ReadInteger("cs_entrymsg", "maxentries", "5", 0, true);
- }
};
MODULE_INIT(CSEntryMessage)