mirror of
https://github.com/anope/anope.git
synced 2026-07-09 11:03:11 +02:00
Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in.
This commit is contained in:
@@ -9,18 +9,16 @@
|
||||
|
||||
class HelpChannel : public Module
|
||||
{
|
||||
Anope::string HelpChan;
|
||||
|
||||
public:
|
||||
HelpChannel(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
|
||||
{
|
||||
Implementation i[] = { I_OnChannelModeSet, I_OnReload };
|
||||
Implementation i[] = { I_OnChannelModeSet };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
}
|
||||
|
||||
EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, const Anope::string &mname, const Anope::string ¶m) anope_override
|
||||
{
|
||||
if (mname == "OP" && c && c->ci && c->name.equals_ci(this->HelpChan))
|
||||
if (mname == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string &>("helpchannel")))
|
||||
{
|
||||
User *u = User::Find(param);
|
||||
|
||||
@@ -30,11 +28,6 @@ class HelpChannel : public Module
|
||||
|
||||
return EVENT_CONTINUE;
|
||||
}
|
||||
|
||||
void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override
|
||||
{
|
||||
this->HelpChan = reader.ReadValue("m_helpchan", "helpchannel", "", 0);
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(HelpChannel)
|
||||
|
||||
Reference in New Issue
Block a user