diff options
Diffstat (limited to 'modules/commands/cs_log.cpp')
-rw-r--r-- | modules/commands/cs_log.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 67d08e4e6..2a6f2d0ec 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -18,7 +18,7 @@ struct LogSettingImpl : LogSetting, Serializable { } - ~LogSettingImpl() + ~LogSettingImpl() override { ChannelInfo *ci = ChannelInfo::Find(chan); if (ci) @@ -33,7 +33,7 @@ struct LogSettingImpl : LogSetting, Serializable } } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["ci"] << chan; data["service_name"] << service_name; @@ -81,7 +81,7 @@ struct LogSettingsImpl : LogSettings { LogSettingsImpl(Extensible *) { } - ~LogSettingsImpl() + ~LogSettingsImpl() override { for (iterator it = (*this)->begin(); it != (*this)->end();) { @@ -91,7 +91,7 @@ struct LogSettingsImpl : LogSettings } } - LogSetting *Create() anope_override + LogSetting *Create() override { return new LogSettingImpl(); } @@ -107,7 +107,7 @@ public: this->SetSyntax(_("\037channel\037 \037command\037 \037method\037 [\037status\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &channel = params[0]; @@ -144,8 +144,8 @@ public: std::vector<Anope::string> replies; list.Process(replies); - for (unsigned i = 0; i < replies.size(); ++i) - source.Reply(replies[i]); + for (const auto &reply : replies) + source.Reply(reply); } } else if (params.size() > 2) @@ -199,12 +199,14 @@ public: return; } - for (unsigned i = 0; i < extra.length(); ++i) - if (ModeManager::GetStatusChar(extra[i]) == 0) + for (auto chr : extra) + { + if (ModeManager::GetStatusChar(chr) == 0) { - source.Reply(_("%c is an unknown status mode."), extra[i]); + source.Reply(_("%c is an unknown status mode."), chr); return; } + } bool override = !source.AccessFor(ci).HasPriv("SET"); @@ -251,7 +253,7 @@ public: this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -301,7 +303,7 @@ class CSLog : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); defaults.clear(); @@ -320,16 +322,14 @@ class CSLog : public Module } } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { if (defaults.empty()) return; LogSettings *ls = logsettings.Require(ci); - for (unsigned i = 0; i < defaults.size(); ++i) + for (auto &d : defaults) { - LogDefault &d = defaults[i]; - LogSetting *log = new LogSettingImpl(); log->chan = ci->name; @@ -353,18 +353,17 @@ class CSLog : public Module } } - void OnLog(Log *l) anope_override + void OnLog(Log *l) override { if (l->type != LOG_COMMAND || l->u == NULL || l->c == NULL || l->ci == NULL || !Me || !Me->IsSynced()) return; LogSettings *ls = logsettings.Get(l->ci); if (ls) - for (unsigned i = 0; i < (*ls)->size(); ++i) + { + for (auto *log : *(*ls)) { - const LogSetting *log = (*ls)->at(i); - - /* wrong command */ + /* wrong command */ if (log->service_name != l->c->name) continue; @@ -393,6 +392,7 @@ class CSLog : public Module else if (log->method.equals_ci("NOTICE") && l->ci->c) IRCD->SendNotice(l->ci->WhoSends(), log->extra + l->ci->c->name, "%s", buffer.c_str()); } + } } }; |