diff options
| author | 2019-01-25 03:27:13 +0000 | |
|---|---|---|
| committer | 2019-01-25 03:27:13 +0000 | |
| commit | b4685e06d45336e7ce7cb138f8261ac120a2d6d3 (patch) | |
| tree | 5381913a67543db4e91a72a4949cf6cde2942711 /src/modules | |
| parent | Migrate m_ssl_gnutls from auto_ptr to shared_ptr. (diff) | |
Remove all 2.0 config compatibility code.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/m_connflood.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_disable.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_filter.cpp | 3 | ||||
| -rw-r--r-- | src/modules/m_noctcp.cpp | 15 | ||||
| -rw-r--r-- | src/modules/m_override.cpp | 22 | ||||
| -rw-r--r-- | src/modules/m_permchannels.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_repeat.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_sslmodes.cpp | 2 |
8 files changed, 11 insertions, 39 deletions
diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index a7c4b2b37..27cf7ce2b 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -48,7 +48,7 @@ public: /* read configuration variables */ ConfigTag* tag = ServerInstance->Config->ConfValue("connflood"); /* throttle configuration */ - seconds = tag->getDuration("period", tag->getDuration("seconds", 30)); + seconds = tag->getDuration("period", 30); maxconns = tag->getUInt("maxconns", 3); timeout = tag->getDuration("timeout", 30); quitmsg = tag->getString("quitmsg"); diff --git a/src/modules/m_disable.cpp b/src/modules/m_disable.cpp index c45d47d7d..fb10a92a0 100644 --- a/src/modules/m_disable.cpp +++ b/src/modules/m_disable.cpp @@ -115,7 +115,7 @@ class ModuleDisable : public Module commands.swap(newcommands); // Whether we should fake the non-existence of disabled things. - fakenonexistent = tag->getBool("fakenonexistent", tag->getBool("fakenonexistant")); + fakenonexistent = tag->getBool("fakenonexistent"); // Whether to notify server operators via snomask `a` about the attempted use of disabled commands/modes. notifyopers = tag->getBool("notifyopers"); diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 63fcc398b..1cb9184eb 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -560,8 +560,7 @@ void ModuleFilter::ReadConfig(ConfigStatus& status) { ConfigTag* tag = i->second; - // If "target" is not found, try the old "channel" key to keep compatibility with 2.0 configs - const std::string target = tag->getString("target", tag->getString("channel")); + const std::string target = tag->getString("target"); if (!target.empty()) { if (target[0] == '#') diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 66f97e6a7..b7e981450 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -22,28 +22,17 @@ #include "inspircd.h" #include "modules/exemption.h" -class NoCTCPUser : public SimpleUserModeHandler -{ -public: - NoCTCPUser(Module* Creator) - : SimpleUserModeHandler(Creator, "u_noctcp", 'T') - { - if (!ServerInstance->Config->ConfValue("noctcp")->getBool("enableumode")) - DisableAutoRegister(); - } -}; - class ModuleNoCTCP : public Module { CheckExemption::EventProvider exemptionprov; SimpleChannelModeHandler nc; - NoCTCPUser ncu; + SimpleUserModeHandler ncu; public: ModuleNoCTCP() : exemptionprov(this) , nc(this, "noctcp", 'C') - , ncu(this) + , ncu(this, "u_noctcp", 'T') { } diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index 9c6914459..79482412a 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -27,23 +27,11 @@ #include "inspircd.h" #include "modules/invite.h" -class Override : public SimpleUserModeHandler -{ - public: - Override(Module* Creator) : SimpleUserModeHandler(Creator, "override", 'O') - { - oper = true; - if (!ServerInstance->Config->ConfValue("override")->getBool("enableumode")) - DisableAutoRegister(); - } -}; - class ModuleOverride : public Module { bool RequireKey; bool NoisyOverride; - bool UmodeEnabled; - Override ou; + SimpleUserModeHandler ou; ChanModeReference topiclock; ChanModeReference inviteonly; ChanModeReference key; @@ -78,8 +66,7 @@ class ModuleOverride : public Module public: ModuleOverride() - : UmodeEnabled(false) - , ou(this) + : ou(this, "override", 'O') , topiclock(this, "topiclock") , inviteonly(this, "inviteonly") , key(this, "key") @@ -91,7 +78,6 @@ class ModuleOverride : public Module void init() override { ServerInstance->SNO->EnableSnomask('v', "OVERRIDE"); - UmodeEnabled = ServerInstance->Config->ConfValue("override")->getBool("enableumode"); } void ReadConfig(ConfigStatus& status) override @@ -109,8 +95,8 @@ class ModuleOverride : public Module bool CanOverride(User* source, const char* token) { - // If we require oper override umode (+O) but it is not set - if (UmodeEnabled && !source->IsModeSet(ou)) + // The oper override umode (+O) is not set + if (!source->IsModeSet(ou)) return false; std::string tokenlist = source->oper->getConfig("override"); diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 2ed7032b0..f1eff77fe 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -72,7 +72,7 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list } stream << "# This file is automatically generated by m_permchannels. Any changes will be overwritten." << std::endl - << "<config format=\"xml\">" << std::endl; + << std::endl; const chan_hash& chans = ServerInstance->GetChans(); for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i) diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index 8b4d7afd7..77e744788 100644 --- a/src/modules/m_repeat.cpp +++ b/src/modules/m_repeat.cpp @@ -235,7 +235,7 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > ConfigTag* conf = ServerInstance->Config->ConfValue("repeat"); ms.MaxLines = conf->getUInt("maxlines", 20); ms.MaxBacklog = conf->getUInt("maxbacklog", 20); - ms.MaxSecs = conf->getDuration("maxtime", conf->getDuration("maxsecs", 0)); + ms.MaxSecs = conf->getDuration("maxtime", 0); ms.MaxDiff = conf->getUInt("maxdistance", 50); if (ms.MaxDiff > 100) diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index 5ec6db960..ba774a135 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -104,8 +104,6 @@ class SSLModeUser : public ModeHandler : ModeHandler(Creator, "sslqueries", 'z', PARAM_NONE, MODETYPE_USER) , API(api) { - if (!ServerInstance->Config->ConfValue("sslmodes")->getBool("enableumode")) - DisableAutoRegister(); } ModeAction OnModeChange(User* user, User* dest, Channel* channel, std::string& parameter, bool adding) override |
