diff options
Diffstat (limited to 'modules/commands')
105 files changed, 696 insertions, 848 deletions
diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index 2c8404aff..2cb580b5b 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -20,7 +20,7 @@ class CommandBSAssign : public Command this->SetSyntax(_("\037channel\037 \037nick\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 &chan = params[0]; const Anope::string &nick = params[1]; @@ -71,7 +71,7 @@ class CommandBSAssign : public Command source.Reply(_("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), ci->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -91,7 +91,7 @@ class CommandBSUnassign : public Command this->SetSyntax(_("\037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -132,7 +132,7 @@ class CommandBSUnassign : public Command source.Reply(_("There is no bot assigned to %s anymore."), ci->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -154,7 +154,7 @@ class CommandBSSetNoBot : public Command this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); const Anope::string &value = params[1]; @@ -191,7 +191,7 @@ class CommandBSSetNoBot : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -217,7 +217,7 @@ class BSAssign : public Module { } - void OnInvite(User *source, Channel *c, User *targ) anope_override + void OnInvite(User *source, Channel *c, User *targ) override { BotInfo *bi; if (Anope::ReadOnly || !c->ci || targ->server != Me || !(bi = dynamic_cast<BotInfo *>(targ))) @@ -246,7 +246,7 @@ class BSAssign : public Module targ->SendMessage(bi, _("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), c->name.c_str()); } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override { if (nobot.HasExt(ci)) info.AddOption(_("No bot")); diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index 31ebebf27..3e397786e 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -17,7 +17,7 @@ struct BadWordImpl : BadWord, Serializable BadWordImpl() : Serializable("BadWord") { } ~BadWordImpl(); - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["ci"] << this->chan; data["word"] << this->word; @@ -37,7 +37,7 @@ struct BadWordsImpl : BadWords ~BadWordsImpl(); - BadWord* AddBadWord(const Anope::string &word, BadWordType type) anope_override + BadWord* AddBadWord(const Anope::string &word, BadWordType type) override { BadWordImpl *bw = new BadWordImpl(); bw->chan = ci->name; @@ -51,7 +51,7 @@ struct BadWordsImpl : BadWords return bw; } - BadWord* GetBadWord(unsigned index) const anope_override + BadWord* GetBadWord(unsigned index) const override { if (this->badwords->empty() || index >= this->badwords->size()) return NULL; @@ -61,12 +61,12 @@ struct BadWordsImpl : BadWords return bw; } - unsigned GetBadWordCount() const anope_override + unsigned GetBadWordCount() const override { return this->badwords->size(); } - void EraseBadWord(unsigned index) anope_override + void EraseBadWord(unsigned index) override { if (this->badwords->empty() || index >= this->badwords->size()) return; @@ -76,13 +76,13 @@ struct BadWordsImpl : BadWords delete this->badwords->at(index); } - void ClearBadWords() anope_override + void ClearBadWords() override { while (!this->badwords->empty()) delete this->badwords->back(); } - void Check() anope_override + void Check() override { if (this->badwords->empty()) ci->Shrink<BadWords>("badwords"); @@ -150,10 +150,10 @@ class BadwordsDelCallback : public NumberList ChannelInfo *ci; BadWords *bw; Command *c; - unsigned deleted; - bool override; + unsigned deleted = 0; + bool override = false; public: - BadwordsDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0), override(false) + BadwordsDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c) { if (!source.AccessFor(ci).HasPriv("BADWORDS") && source.HasPriv("botserv/administration")) this->override = true; @@ -170,7 +170,7 @@ class BadwordsDelCallback : public NumberList source.Reply(_("Deleted %d entries from %s bad words list."), deleted, ci->name.c_str()); } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!bw || !Number || Number > bw->GetBadWordCount()) return; @@ -209,7 +209,7 @@ class CommandBSBadwords : public Command { } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > bw->GetBadWordCount()) return; @@ -374,7 +374,7 @@ class CommandBSBadwords : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - 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 &cmd = params[1]; const Anope::string &word = params.size() > 2 ? params[2] : ""; @@ -417,7 +417,7 @@ class CommandBSBadwords : public Command 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(" "); diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index 4f347f6dc..78f3aa931 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -272,7 +272,7 @@ class CommandBSBot : public Command this->SetSyntax(_("\002DEL \037nick\037\002")); } - 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 &cmd = params[0]; @@ -345,7 +345,7 @@ class CommandBSBot : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_botlist.cpp b/modules/commands/bs_botlist.cpp index e8f979cde..ceb3bb3fc 100644 --- a/modules/commands/bs_botlist.cpp +++ b/modules/commands/bs_botlist.cpp @@ -19,7 +19,7 @@ class CommandBSBotList : public Command this->SetDesc(_("Lists available bots")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { unsigned count = 0; ListFormatter list(source.GetAccount()); @@ -57,7 +57,7 @@ class CommandBSBotList : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 1f4eaa48f..407912baa 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -20,7 +20,7 @@ class CommandBSSay : public Command this->SetSyntax(_("\037channel\037 \037text\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 &text = params[1]; @@ -62,7 +62,7 @@ class CommandBSSay : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << text; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -80,7 +80,7 @@ class CommandBSAct : public Command this->SetSyntax(_("\037channel\037 \037text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string message = params[1]; @@ -120,7 +120,7 @@ class CommandBSAct : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << message; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index 475a54003..dd72a973a 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -41,7 +41,7 @@ class CommandBSInfo : public Command this->SetSyntax(_("{\037channel\037 | \037nickname\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 &query = params[0]; @@ -101,7 +101,7 @@ class CommandBSInfo : public Command source.Reply(_("\002%s\002 is not a valid bot or registered channel."), query.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -113,7 +113,7 @@ class CommandBSInfo : public Command return true; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Allows you to see %s information about a channel or a bot")), source.service->nick.c_str()); } diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 1a0ec73df..265864704 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -29,7 +29,7 @@ struct KickerDataImpl : KickerData dontkickops = dontkickvoices = false; } - void Check(ChannelInfo *ci) anope_override + void Check(ChannelInfo *ci) override { if (amsgs || badwords || bolds || caps || colors || flood || italics || repeat || reverses || underlines) return; @@ -41,7 +41,7 @@ struct KickerDataImpl : KickerData { ExtensibleItem(Module *m, const Anope::string &ename) : ::ExtensibleItem<KickerDataImpl>(m, ename) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { if (s->GetSerializableType()->GetName() != "ChannelInfo") return; @@ -71,7 +71,7 @@ struct KickerDataImpl : KickerData data["ttb"] << kd->ttb[i] << " "; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { if (s->GetSerializableType()->GetName() != "ChannelInfo") return; @@ -120,12 +120,12 @@ class CommandBSKick : public Command this->SetSyntax(_("\037option\037 \037channel\037 {\037ON|OFF\037} [\037settings\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { 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(" "); @@ -165,9 +165,9 @@ class CommandBSKickBase : public Command { } - virtual void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override = 0; + virtual void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override = 0; - virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override = 0; + virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) override = 0; protected: bool CheckArguments(CommandSource &source, const std::vector<Anope::string> ¶ms, ChannelInfo* &ci) @@ -252,7 +252,7 @@ class CommandBSKickAMSG : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -263,7 +263,7 @@ class CommandBSKickAMSG : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -288,7 +288,7 @@ class CommandBSKickBadwords : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -300,7 +300,7 @@ class CommandBSKickBadwords : public CommandBSKickBase } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -327,7 +327,7 @@ class CommandBSKickBolds : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -338,7 +338,7 @@ class CommandBSKickBolds : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -361,7 +361,7 @@ class CommandBSKickCaps : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037min\037 [\037percent\037]]]\002")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -429,7 +429,7 @@ class CommandBSKickCaps : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -457,7 +457,7 @@ class CommandBSKickColors : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -468,7 +468,7 @@ class CommandBSKickColors : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -491,7 +491,7 @@ class CommandBSKickFlood : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037ln\037 [\037secs\037]]]\002")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -564,7 +564,7 @@ class CommandBSKickFlood : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -589,7 +589,7 @@ class CommandBSKickItalics : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -600,7 +600,7 @@ class CommandBSKickItalics : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -623,7 +623,7 @@ class CommandBSKickRepeat : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037num\037]]\002")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -699,7 +699,7 @@ class CommandBSKickRepeat : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -724,7 +724,7 @@ class CommandBSKickReverses : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -735,7 +735,7 @@ class CommandBSKickReverses : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -758,7 +758,7 @@ class CommandBSKickUnderlines : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -769,7 +769,7 @@ class CommandBSKickUnderlines : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -792,7 +792,7 @@ class CommandBSSetDontKickOps : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -837,7 +837,7 @@ class CommandBSSetDontKickOps : public Command kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -857,7 +857,7 @@ class CommandBSSetDontKickVoices : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -902,7 +902,7 @@ class CommandBSSetDontKickVoices : public Command kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -989,7 +989,7 @@ class BanDataPurger : public Timer public: BanDataPurger(Module *o) : Timer(o, 300, Anope::CurTime, true) { } - void Tick(time_t) anope_override + void Tick(time_t) override { Log(LOG_DEBUG) << "bs_main: Running bandata purger"; @@ -1106,7 +1106,7 @@ class BSKick : public Module } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override { if (!ci) return; @@ -1221,7 +1221,7 @@ class BSKick : public Module info.AddOption(_("Voices protection")); } - void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override + void OnPrivmsg(User *u, Channel *c, Anope::string &msg) override { /* Now we can make kicker stuff. We try to order the checks * from the fastest one to the slowest one, since there's diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index a14706c9d..b54543e00 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -20,12 +20,12 @@ class CommandBSSet : public Command this->SetSyntax(_("\037option\037 \037(channel | bot)\037 \037settings\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { 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(" "); @@ -77,7 +77,7 @@ class CommandBSSetBanExpire : public Command public: UnbanTimer(Module *creator, const Anope::string &ch, const Anope::string &bmask, time_t t) : Timer(creator, t), chname(ch), mask(bmask) { } - void Tick(time_t) anope_override + void Tick(time_t) override { Channel *c = Channel::Find(chname); if (c) @@ -91,7 +91,7 @@ class CommandBSSetBanExpire : public Command this->SetSyntax(_("\037channel\037 \037time\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 &chan = params[0]; const Anope::string &arg = params[1]; @@ -141,7 +141,7 @@ class CommandBSSetBanExpire : public Command source.Reply(_("Bot bans will automatically expire after %s."), Anope::Duration(ci->banexpire, source.GetAccount()).c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -162,7 +162,7 @@ class CommandBSSetPrivate : public Command this->SetSyntax(_("\037botname\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { BotInfo *bi = BotInfo::Find(params[0], true); const Anope::string &value = params[1]; @@ -193,7 +193,7 @@ class CommandBSSetPrivate : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -216,7 +216,7 @@ class BSSet : public Module { } - void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) anope_override + void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) override { if (!ci->banexpire) return; diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 386978340..ee6d324c7 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -23,23 +23,23 @@ static inline void reset_levels(ChannelInfo *ci) class AccessChanAccess : public ChanAccess { public: - int level; + int level = 0; - AccessChanAccess(AccessProvider *p) : ChanAccess(p), level(0) + AccessChanAccess(AccessProvider *p) : ChanAccess(p) { } - bool HasPriv(const Anope::string &name) const anope_override + bool HasPriv(const Anope::string &name) const override { return this->ci->GetLevel(name) != ACCESS_INVALID && this->level >= this->ci->GetLevel(name); } - Anope::string AccessSerialize() const anope_override + Anope::string AccessSerialize() const override { return stringify(this->level); } - void AccessUnserialize(const Anope::string &data) anope_override + void AccessUnserialize(const Anope::string &data) override { try { @@ -50,7 +50,7 @@ class AccessChanAccess : public ChanAccess } } - bool operator>(const ChanAccess &other) const anope_override + bool operator>(const ChanAccess &other) const override { if (this->provider != other.provider) return ChanAccess::operator>(other); @@ -58,7 +58,7 @@ class AccessChanAccess : public ChanAccess return this->level > anope_dynamic_static_cast<const AccessChanAccess *>(&other)->level; } - bool operator<(const ChanAccess &other) const anope_override + bool operator<(const ChanAccess &other) const override { if (this->provider != other.provider) return ChanAccess::operator<(other); @@ -77,7 +77,7 @@ class AccessAccessProvider : public AccessProvider me = this; } - ChanAccess *Create() anope_override + ChanAccess *Create() override { return new AccessChanAccess(this); } @@ -250,12 +250,12 @@ class CommandCSAccess : public Command CommandSource &source; ChannelInfo *ci; Command *c; - unsigned deleted; + unsigned deleted = 0; Anope::string Nicks; - bool denied; - bool override; + bool denied = false; + bool override = false; public: - AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), deleted(0), denied(false), override(false) + AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c) { if (!source.AccessFor(ci).HasPriv("ACCESS_CHANGE") && source.HasPriv("chanserv/access/modify")) this->override = true; @@ -278,7 +278,7 @@ class CommandCSAccess : public Command } } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > ci->GetAccessCount()) return; @@ -359,7 +359,7 @@ class CommandCSAccess : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > ci->GetAccessCount()) return; @@ -503,7 +503,7 @@ class CommandCSAccess : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - 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 &cmd = params[1]; const Anope::string &nick = params.size() > 2 ? params[2] : ""; @@ -561,7 +561,7 @@ class CommandCSAccess : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -745,7 +745,7 @@ class CommandCSLevels : public Command this->SetSyntax(_("\037channel\037 RESET")); } - 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 &cmd = params[1]; const Anope::string &what = params.size() > 2 ? params[2] : ""; @@ -789,7 +789,7 @@ class CommandCSLevels : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (subcommand.equals_ci("DESC")) { @@ -856,7 +856,7 @@ class CSAccess : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { defaultLevels.clear(); @@ -882,12 +882,12 @@ class CSAccess : public Module } } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnCreateChan(ChannelInfo *ci) override { reset_levels(ci); } - EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) anope_override + EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) override { if (group->ci == NULL) return EVENT_CONTINUE; diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index d10f223cd..94e1955ff 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -211,10 +211,10 @@ class CommandCSAKick : public Command CommandSource &source; ChannelInfo *ci; Command *c; - unsigned deleted; + unsigned deleted = 0; AccessGroup ag; public: - AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0), ag(source.AccessFor(ci)) + AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), ag(source.AccessFor(ci)) { } @@ -228,7 +228,7 @@ class CommandCSAKick : public Command source.Reply(_("Deleted %d entries from %s autokick list."), deleted, ci->name.c_str()); } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > ci->GetAkickCount()) return; @@ -293,7 +293,7 @@ class CommandCSAKick : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > ci->GetAkickCount()) return; @@ -440,7 +440,7 @@ class CommandCSAKick : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string chan = params[0]; Anope::string cmd = params[1]; @@ -485,7 +485,7 @@ class CommandCSAKick : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { BotInfo *bi = Config->GetClient("NickServ"); this->SendSyntax(source); @@ -538,7 +538,7 @@ class CSAKick : public Module { } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { if (!c->ci || c->MatchesList(u, "EXCEPT")) return EVENT_CONTINUE; diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index 648651dfa..d35932bba 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -23,7 +23,7 @@ class TempBan : public Timer public: TempBan(time_t seconds, Channel *c, const Anope::string &banmask, const Anope::string &mod) : Timer(me, seconds), channel(c->name), mask(banmask), mode(mod) { } - void Tick(time_t ctime) anope_override + void Tick(time_t ctime) override { Channel *c = Channel::Find(this->channel); if (c) @@ -40,7 +40,7 @@ class CommandCSBan : public Command this->SetSyntax(_("\037channel\037 [+\037expiry\037] {\037nick\037 | \037mask\037} [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Configuration::Block *block = Config->GetCommand(source); const Anope::string &mode = block->Get<Anope::string>("mode", "BAN"); @@ -223,7 +223,7 @@ class CommandCSBan : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index 4bfe8b639..70e2a7425 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -115,7 +115,7 @@ public: this->SetSyntax(_("\037channel\037 \037target\037 [\037what\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]; const Anope::string &target = params[1]; @@ -235,7 +235,7 @@ public: Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to clone " << (what.empty() ? "everything from it" : what) << " to " << target_ci->name; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index d5fea7e1a..30db66c71 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -20,7 +20,7 @@ class CommandCSDrop : public Command this->SetSyntax(_("\037channel\037 \037channel\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 &chan = params[0]; @@ -66,7 +66,7 @@ class CommandCSDrop : public Command c->CheckModes(); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_enforce.cpp b/modules/commands/cs_enforce.cpp index 8f21c8c35..6b34b4741 100644 --- a/modules/commands/cs_enforce.cpp +++ b/modules/commands/cs_enforce.cpp @@ -119,7 +119,7 @@ class CommandCSEnforce : public Command if (user->IsProtected()) continue; - if (!user->HasMode("SSL") && !user->HasExt("ssl")) + if (!user->IsSecurelyConnected()) users.push_back(user); } @@ -228,7 +228,7 @@ class CommandCSEnforce : public Command this->SetSyntax(_("\037channel\037 \037what\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 &what = params.size() > 1 ? params[1] : ""; @@ -256,7 +256,7 @@ class CommandCSEnforce : public Command 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(" "); diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 8e4bd9b15..f29581936 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -28,7 +28,7 @@ struct EntryMsgImpl : EntryMsg, Serializable ~EntryMsgImpl(); - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["ci"] << this->chan; data["creator"] << this->creator; @@ -43,7 +43,7 @@ struct EntryMessageListImpl : EntryMessageList { EntryMessageListImpl(Extensible *) { } - EntryMsg* Create() anope_override + EntryMsg* Create() override { return new EntryMsgImpl(); } @@ -197,7 +197,7 @@ class CommandEntryMessage : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -232,7 +232,7 @@ class CommandEntryMessage : public Command 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(" "); @@ -273,7 +273,7 @@ class CSEntryMessage : public Module { } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { if (u && c && c->ci && u->server->IsSynced()) { diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 5fca415de..e891335ef 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -22,7 +22,7 @@ class FlagsChanAccess : public ChanAccess { } - bool HasPriv(const Anope::string &priv) const anope_override + bool HasPriv(const Anope::string &priv) const override { std::map<Anope::string, char>::iterator it = defaultFlags.find(priv); if (it != defaultFlags.end() && this->flags.count(it->second) > 0) @@ -30,12 +30,12 @@ class FlagsChanAccess : public ChanAccess return false; } - Anope::string AccessSerialize() const anope_override + Anope::string AccessSerialize() const override { return Anope::string(this->flags.begin(), this->flags.end()); } - void AccessUnserialize(const Anope::string &data) anope_override + void AccessUnserialize(const Anope::string &data) override { for (unsigned i = data.length(); i > 0; --i) this->flags.insert(data[i - 1]); @@ -69,7 +69,7 @@ class FlagsAccessProvider : public AccessProvider ap = this; } - ChanAccess *Create() anope_override + ChanAccess *Create() override { return new FlagsChanAccess(this); } @@ -376,7 +376,7 @@ class CommandCSFlags : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - 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 &chan = params[0]; const Anope::string &cmd = params.size() > 1 ? params[1] : ""; @@ -425,7 +425,7 @@ class CommandCSFlags : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -478,7 +478,7 @@ class CSFlags : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { defaultFlags.clear(); diff --git a/modules/commands/cs_getkey.cpp b/modules/commands/cs_getkey.cpp index 421d7e513..fe12cb8a5 100644 --- a/modules/commands/cs_getkey.cpp +++ b/modules/commands/cs_getkey.cpp @@ -20,7 +20,7 @@ class CommandCSGetKey : public Command this->SetSyntax(_("\037channel\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 &chan = params[0]; @@ -50,7 +50,7 @@ class CommandCSGetKey : public Command source.Reply(_("Key for channel \002%s\002 is \002%s\002."), chan.c_str(), key.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index 781df0205..03c72563d 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -21,7 +21,7 @@ class CommandCSInfo : public Command this->AllowUnregistered(true); } - 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 &chan = params[0]; @@ -69,7 +69,7 @@ class CommandCSInfo : public Command source.Reply(replies[i]); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_invite.cpp b/modules/commands/cs_invite.cpp index 6526db23c..3b4753da3 100644 --- a/modules/commands/cs_invite.cpp +++ b/modules/commands/cs_invite.cpp @@ -20,7 +20,7 @@ class CommandCSInvite : public Command this->SetSyntax(_("\037channel\037 [\037nick\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 &chan = params[0]; @@ -84,7 +84,7 @@ class CommandCSInvite : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp index 4ba3d2c8a..0589d5e05 100644 --- a/modules/commands/cs_kick.cpp +++ b/modules/commands/cs_kick.cpp @@ -21,7 +21,7 @@ class CommandCSKick : public Command this->SetSyntax(_("\037channel\037 \037mask\037 [\037reason\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 &chan = params[0]; const Anope::string &target = params[1]; @@ -121,7 +121,7 @@ class CommandCSKick : public Command source.Reply(NICK_X_NOT_IN_USE, target.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp index c64b96957..d25e0b1eb 100644 --- a/modules/commands/cs_list.cpp +++ b/modules/commands/cs_list.cpp @@ -21,7 +21,7 @@ class CommandCSList : public Command this->SetSyntax(_("\037pattern\037 [SUSPENDED] [NOEXPIRE]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string pattern = params[0]; unsigned nchans; @@ -130,7 +130,7 @@ class CommandCSList : public Command source.Reply(_("End of list - %d/%d matches shown."), nchans > listmax ? listmax : nchans, nchans); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -181,7 +181,7 @@ class CommandCSSetPrivate : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -225,7 +225,7 @@ class CommandCSSetPrivate : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -253,7 +253,7 @@ class CSList : public Module { } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override { if (!show_all) return; diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index b4ea75d3c..157d3692e 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -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; @@ -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]; @@ -251,7 +251,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 +301,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,7 +320,7 @@ class CSLog : public Module } } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { if (defaults.empty()) return; @@ -353,7 +353,7 @@ 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; diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 0f6378036..17ecc566c 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -29,7 +29,7 @@ struct ModeLockImpl : ModeLock, Serializable } } - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; @@ -53,7 +53,7 @@ struct ModeLocksImpl : ModeLocks } } - bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const anope_override + bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const override { if (!mode) return false; @@ -69,7 +69,7 @@ struct ModeLocksImpl : ModeLocks return false; } - bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m, Anope::string setter, time_t created = Anope::CurTime) anope_override + bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m, Anope::string setter, time_t created = Anope::CurTime) override { if (!mode) return false; @@ -99,7 +99,7 @@ struct ModeLocksImpl : ModeLocks return true; } - bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "") anope_override + bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "") override { if (!mode) return false; @@ -128,14 +128,14 @@ struct ModeLocksImpl : ModeLocks return false; } - void RemoveMLock(ModeLock *mlock) anope_override + void RemoveMLock(ModeLock *mlock) override { ModeList::iterator it = std::find(this->mlocks->begin(), this->mlocks->end(), mlock); if (it != this->mlocks->end()) this->mlocks->erase(it); } - void ClearMLock() anope_override + void ClearMLock() override { ModeList ml; this->mlocks->swap(ml); @@ -143,12 +143,12 @@ struct ModeLocksImpl : ModeLocks delete ml[i]; } - const ModeList &GetMLock() const anope_override + const ModeList &GetMLock() const override { return this->mlocks; } - std::list<ModeLock *> GetModeLockList(const Anope::string &name) anope_override + std::list<ModeLock *> GetModeLockList(const Anope::string &name) override { std::list<ModeLock *> mlist; for (ModeList::const_iterator it = this->mlocks->begin(); it != this->mlocks->end(); ++it) @@ -160,7 +160,7 @@ struct ModeLocksImpl : ModeLocks return mlist; } - const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "") anope_override + const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "") override { for (ModeList::const_iterator it = this->mlocks->begin(); it != this->mlocks->end(); ++it) { @@ -173,7 +173,7 @@ struct ModeLocksImpl : ModeLocks return NULL; } - Anope::string GetMLockAsString(bool complete) const anope_override + Anope::string GetMLockAsString(bool complete) const override { Anope::string pos = "+", neg = "-", params; @@ -202,7 +202,7 @@ struct ModeLocksImpl : ModeLocks return pos + neg + params; } - void Check() anope_override + void Check() override { if (this->mlocks->empty()) ci->Shrink<ModeLocks>("modelocks"); @@ -736,7 +736,7 @@ class CommandCSMode : public Command this->SetSyntax(_("\037channel\037 CLEAR [\037what\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 &subcommand = params[1]; @@ -766,7 +766,7 @@ class CommandCSMode : public Command 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(" "); @@ -807,7 +807,7 @@ class CommandCSModes : public Command this->SetSyntax(_("\037channel\037 [\037user\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(), *targ = params.size() > 1 ? User::Find(params[1], true) : u; @@ -879,7 +879,7 @@ class CommandCSModes : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "on " << targ->nick; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { const std::pair<bool, Anope::string> &m = modes[source.command]; if (!m.second.empty()) @@ -893,7 +893,7 @@ class CommandCSModes : public Command return ""; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { const std::pair<bool, Anope::string> &m = modes[source.command]; if (m.second.empty()) @@ -932,7 +932,7 @@ class CSMode : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { modes.clear(); @@ -956,7 +956,7 @@ class CSMode : public Module } } - void OnCheckModes(Reference<Channel> &c) anope_override + void OnCheckModes(Reference<Channel> &c) override { if (!c || !c->ci) return; @@ -1005,7 +1005,7 @@ class CSMode : public Module } } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { ModeLocks *ml = modelocks.Require(ci); Anope::string mlock; @@ -1055,7 +1055,7 @@ class CSMode : public Module ml->Check(); } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) override { if (!show_hidden) return; diff --git a/modules/commands/cs_register.cpp b/modules/commands/cs_register.cpp index 58702bb67..c85ac8ff8 100644 --- a/modules/commands/cs_register.cpp +++ b/modules/commands/cs_register.cpp @@ -20,7 +20,7 @@ class CommandCSRegister : public Command this->SetSyntax(_("\037channel\037 [\037description\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 &chan = params[0]; const Anope::string &chdesc = params.size() > 1 ? params[1] : ""; @@ -79,7 +79,7 @@ class CommandCSRegister : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index b36b4faf9..913b2d408 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -43,7 +43,7 @@ struct SeenInfo : Serializable database.erase(iter); } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["nick"] << nick; data["vhost"] << vhost; @@ -119,7 +119,7 @@ class CommandOSSeen : public Command this->SetSyntax(_("CLEAR \037time\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params[0].equals_ci("STATS")) { @@ -165,7 +165,7 @@ class CommandOSSeen : public Command this->SendSyntax(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(" "); @@ -263,7 +263,7 @@ class CommandSeen : public Command this->AllowUnregistered(true); } - 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 &target = params[0]; @@ -360,7 +360,7 @@ class CommandSeen : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -381,12 +381,12 @@ class CSSeen : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { simple = conf->GetModule(this)->Get<bool>("simple"); } - void OnExpireTick() anope_override + void OnExpireTick() override { size_t previous_size = database.size(); time_t purgetime = Config->GetModule(this)->Get<time_t>("purgetime"); @@ -406,34 +406,34 @@ class CSSeen : public Module Log(LOG_DEBUG) << "cs_seen: Purged database, checked " << previous_size << " nicks and removed " << (previous_size - database.size()) << " old entries."; } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (!u->Quitting()) UpdateUser(u, NEW, u->nick, "", "", ""); } - void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override + void OnUserNickChange(User *u, const Anope::string &oldnick) override { UpdateUser(u, NICK_TO, oldnick, u->nick, "", ""); UpdateUser(u, NICK_FROM, u->nick, oldnick, "", ""); } - void OnUserQuit(User *u, const Anope::string &msg) anope_override + void OnUserQuit(User *u, const Anope::string &msg) override { UpdateUser(u, QUIT, u->nick, "", "", msg); } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { UpdateUser(u, JOIN, u->nick, "", c->name, ""); } - void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) anope_override + void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) override { UpdateUser(u, PART, u->nick, "", channel, msg); } - void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &msg) anope_override + void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &msg) override { UpdateUser(cu->user, KICK, cu->user->nick, source.GetSource(), cu->chan->name, msg); } diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index bac64612a..80b750c98 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -21,12 +21,12 @@ class CommandCSSet : public Command this->SetSyntax(_("\037option\037 \037channel\037 \037parameters\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { 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(" "); @@ -75,7 +75,7 @@ class CommandCSSetAutoOp : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -117,7 +117,7 @@ class CommandCSSetAutoOp : public Command this->OnSyntaxError(source, "AUTOOP"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -138,7 +138,7 @@ class CommandCSSetBanType : public Command this->SetSyntax(_("\037channel\037 \037bantype\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -179,7 +179,7 @@ class CommandCSSetBanType : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -205,7 +205,7 @@ class CommandCSSetDescription : public Command this->SetSyntax(_("\037channel\037 [\037description\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -248,7 +248,7 @@ class CommandCSSetDescription : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -267,7 +267,7 @@ class CommandCSSetFounder : public Command this->SetSyntax(_("\037channel\037 \037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -317,7 +317,7 @@ class CommandCSSetFounder : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -336,7 +336,7 @@ class CommandCSSetKeepModes : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -381,7 +381,7 @@ class CommandCSSetKeepModes : public Command this->OnSyntaxError(source, "KEEPMODES"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -401,7 +401,7 @@ class CommandCSSetPeace : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -445,7 +445,7 @@ class CommandCSSetPeace : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -473,7 +473,7 @@ class CommandCSSetPersist : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -583,7 +583,7 @@ class CommandCSSetPersist : public Command this->OnSyntaxError(source, "PERSIST"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { BotInfo *BotServ = Config->GetClient("BotServ"); BotInfo *ChanServ = Config->GetClient("ChanServ"); @@ -622,7 +622,7 @@ class CommandCSSetRestricted : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -664,7 +664,7 @@ class CommandCSSetRestricted : public Command this->OnSyntaxError(source, "RESTRICTED"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -684,7 +684,7 @@ class CommandCSSetSecure : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -726,7 +726,7 @@ class CommandCSSetSecure : public Command this->OnSyntaxError(source, "SECURE"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -747,7 +747,7 @@ class CommandCSSetSecureFounder : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -789,7 +789,7 @@ class CommandCSSetSecureFounder : public Command this->OnSyntaxError(source, "SECUREFOUNDER"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -811,7 +811,7 @@ class CommandCSSetSecureOps : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -853,7 +853,7 @@ class CommandCSSetSecureOps : public Command this->OnSyntaxError(source, "SECUREOPS"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -873,7 +873,7 @@ class CommandCSSetSignKick : public Command this->SetSyntax(_("\037channel\037 {ON | LEVEL | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -925,7 +925,7 @@ class CommandCSSetSignKick : public Command this->OnSyntaxError(source, "SIGNKICK"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -950,7 +950,7 @@ class CommandCSSetSuccessor : public Command this->SetSyntax(_("\037channel\037 [\037nick\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -1010,7 +1010,7 @@ class CommandCSSetSuccessor : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1044,7 +1044,7 @@ class CommandCSSetNoexpire : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -1083,7 +1083,7 @@ class CommandCSSetNoexpire : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1103,7 +1103,7 @@ class CSSet : public Module { KeepModes(Module *m, const Anope::string &n) : SerializableExtensibleItem<bool>(m, n) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { SerializableExtensibleItem<bool>::ExtensibleSerialize(e, s, data); @@ -1123,7 +1123,7 @@ class CSSet : public Module data["last_modes"] << modes; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { SerializableExtensibleItem<bool>::ExtensibleUnserialize(e, s, data); @@ -1184,17 +1184,17 @@ class CSSet : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { persist_lower_ts = conf->GetModule(this)->Get<bool>("persist_lower_ts"); } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnCreateChan(ChannelInfo *ci) override { ci->bantype = Config->GetModule(this)->Get<int>("defbantype", "2"); } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (c->ci && keep_modes.HasExt(c->ci)) { @@ -1204,7 +1204,7 @@ class CSSet : public Module } } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { if (!c->ci || !restricted.HasExt(c->ci) || c->MatchesList(u, "EXCEPT")) return EVENT_CONTINUE; @@ -1215,14 +1215,14 @@ class CSSet : public Module return EVENT_CONTINUE; } - void OnDelChan(ChannelInfo *ci) anope_override + void OnDelChan(ChannelInfo *ci) override { if (ci->c && persist.HasExt(ci)) ci->c->RemoveMode(ci->WhoSends(), "PERM", "", false); persist.Unset(ci); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { if (c->ci) { @@ -1237,7 +1237,7 @@ class CSSet : public Module return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { if (mode->name == "PERM") { @@ -1251,7 +1251,7 @@ class CSSet : public Module return EVENT_CONTINUE; } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { if (u->server != Me && persist_lower_ts && c->ci && persist.HasExt(c->ci) && c->creation_time > c->ci->time_registered) { @@ -1262,7 +1262,7 @@ class CSSet : public Module } } - void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) anope_override + void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) override { if (chan->ci) { @@ -1274,13 +1274,13 @@ class CSSet : public Module } } - void OnPreChanExpire(ChannelInfo *ci, bool &expire) anope_override + void OnPreChanExpire(ChannelInfo *ci, bool &expire) override { if (noexpire.HasExt(ci)) expire = false; } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override { if (!show_all) return; diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 49cd99e16..765cea7ba 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -42,7 +42,7 @@ struct CSMiscData : MiscData, Serializable data = d; } - void Serialize(Serialize::Data &sdata) const anope_override + void Serialize(Serialize::Data &sdata) const override { sdata["ci"] << this->object; sdata["name"] << this->name; @@ -96,7 +96,7 @@ class CommandCSSetMisc : public Command this->SetSyntax(_("\037channel\037 [\037parameters\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -143,7 +143,7 @@ class CommandCSSetMisc : public Command } } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { if (descriptions.count(source.command)) { @@ -152,7 +152,7 @@ class CommandCSSetMisc : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (descriptions.count(source.command)) { @@ -182,7 +182,7 @@ class CSSetMisc : public Module delete it->second; } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { descriptions.clear(); @@ -203,7 +203,7 @@ class CSSetMisc : public Module } } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool) override { for (Anope::map<ExtensibleItem<CSMiscData> *>::iterator it = items.begin(); it != items.end(); ++it) { diff --git a/modules/commands/cs_status.cpp b/modules/commands/cs_status.cpp index c34a259eb..b297b8224 100644 --- a/modules/commands/cs_status.cpp +++ b/modules/commands/cs_status.cpp @@ -20,7 +20,7 @@ public: this->SetSyntax(_("\037channel\037 [\037user\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]; @@ -99,7 +99,7 @@ public: } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index 4d0ba3091..7bd5f1a2e 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -16,7 +16,7 @@ struct CSSuspendInfo : SuspendInfo, Serializable { CSSuspendInfo(Extensible *) : Serializable("CSSuspendInfo") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["chan"] << what; data["by"] << by; @@ -59,7 +59,7 @@ class CommandCSSuspend : public Command this->SetSyntax(_("\037channel\037 [+\037expiry\037] [\037reason\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 &chan = params[0]; Anope::string expiry = params[1]; @@ -127,7 +127,7 @@ class CommandCSSuspend : public Command FOREACH_MOD(OnChanSuspend, (ci)); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -152,7 +152,7 @@ class CommandCSUnSuspend : public Command this->SetSyntax(_("\037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) @@ -184,7 +184,7 @@ class CommandCSUnSuspend : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -222,7 +222,7 @@ class CSSuspend : public Module { } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) override { CSSuspendInfo *si = suspend.Get(ci); if (!si) @@ -240,7 +240,7 @@ class CSSuspend : public Module info[_("Suspension expires")] = Anope::strftime(si->expires, source.GetAccount()); } - void OnPreChanExpire(ChannelInfo *ci, bool &expire) anope_override + void OnPreChanExpire(ChannelInfo *ci, bool &expire) override { CSSuspendInfo *si = suspend.Get(ci); if (!si) @@ -260,7 +260,7 @@ class CSSuspend : public Module } } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { if (u->HasMode("OPER") || !c->ci || !suspend.HasExt(c->ci)) return EVENT_CONTINUE; @@ -269,7 +269,7 @@ class CSSuspend : public Module return EVENT_STOP; } - EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) anope_override + EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) override { CSSuspendInfo *si = suspend.Get(ci); if (si && !source.HasCommand("chanserv/drop")) diff --git a/modules/commands/cs_sync.cpp b/modules/commands/cs_sync.cpp index 5209f4df1..a0268bf03 100644 --- a/modules/commands/cs_sync.cpp +++ b/modules/commands/cs_sync.cpp @@ -20,7 +20,7 @@ class CommandCSSync : public Command this->SetSyntax(_("\037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); @@ -42,7 +42,7 @@ class CommandCSSync : public Command } } - bool OnHelp(CommandSource &source, const Anope::string ¶ms) anope_override + bool OnHelp(CommandSource &source, const Anope::string ¶ms) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index 92098dcc9..95b67e832 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -21,7 +21,7 @@ class CommandCSSetKeepTopic : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -63,7 +63,7 @@ class CommandCSSetKeepTopic : public Command this->OnSyntaxError(source, "KEEPTOPIC"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -152,7 +152,7 @@ class CommandCSTopic : public Command this->SetSyntax(_("\037channel\037 [UNLOCK|LOCK]")); } - 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 &subcmd = params[1]; @@ -186,7 +186,7 @@ class CommandCSTopic : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -216,7 +216,7 @@ class CSTopic : public Module } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (c->ci) { @@ -228,7 +228,7 @@ class CSTopic : public Module } } - void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) anope_override + void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) override { if (!c->ci) return; @@ -250,7 +250,7 @@ class CSTopic : public Module } } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) override { if (keeptopic.HasExt(ci)) info.AddOption(_("Topic retention")); diff --git a/modules/commands/cs_unban.cpp b/modules/commands/cs_unban.cpp index 101032807..897ad468f 100644 --- a/modules/commands/cs_unban.cpp +++ b/modules/commands/cs_unban.cpp @@ -20,7 +20,7 @@ class CommandCSUnban : public Command this->SetSyntax(_("\037channel\037 [\037nick\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelMode *cm = ModeManager::FindChannelModeByName("BAN"); if (!cm) @@ -96,7 +96,7 @@ class CommandCSUnban : public Command source.Reply(_("\002%s\002 has been unbanned from \002%s\002."), u2->nick.c_str(), ci->c->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_updown.cpp b/modules/commands/cs_updown.cpp index 0203c9e5b..9bc40e218 100644 --- a/modules/commands/cs_updown.cpp +++ b/modules/commands/cs_updown.cpp @@ -49,7 +49,7 @@ class CommandCSUp : public Command this->SetSyntax(_("[\037channel\037 [\037nick\037]]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params.empty()) { @@ -119,7 +119,7 @@ class CommandCSUp : public Command } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -147,7 +147,7 @@ class CommandCSDown : public Command this->SetSyntax(_("[\037channel\037 [\037nick\037]]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params.empty()) { @@ -216,7 +216,7 @@ class CommandCSDown : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 2b0cf413f..423bdd552 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -26,7 +26,7 @@ class XOPChanAccess : public ChanAccess { } - bool HasPriv(const Anope::string &priv) const anope_override + bool HasPriv(const Anope::string &priv) const override { for (std::vector<Anope::string>::iterator it = std::find(order.begin(), order.end(), this->type); it != order.end(); ++it) { @@ -37,12 +37,12 @@ class XOPChanAccess : public ChanAccess return false; } - Anope::string AccessSerialize() const anope_override + Anope::string AccessSerialize() const override { return this->type; } - void AccessUnserialize(const Anope::string &data) anope_override + void AccessUnserialize(const Anope::string &data) override { this->type = data; } @@ -88,7 +88,7 @@ class XOPAccessProvider : public AccessProvider { } - ChanAccess *Create() anope_override + ChanAccess *Create() override { return new XOPChanAccess(this); } @@ -280,11 +280,11 @@ class CommandCSXOP : public Command CommandSource &source; ChannelInfo *ci; Command *c; - unsigned deleted; + unsigned deleted = 0; Anope::string nicks; bool override; public: - XOPDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, bool _override, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), deleted(0), override(_override) + XOPDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, bool _override, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), override(_override) { } @@ -303,7 +303,7 @@ class CommandCSXOP : public Command } } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > ci->GetAccessCount()) return; @@ -388,7 +388,7 @@ class CommandCSXOP : public Command { } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > ci->GetAccessCount()) return; @@ -484,12 +484,12 @@ class CommandCSXOP : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Modify the list of %s users")), source.command.upper().c_str()); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -513,7 +513,7 @@ class CommandCSXOP : public Command } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { const Anope::string &cmd = source.command.upper(); @@ -590,7 +590,7 @@ class CSXOP : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { order.clear(); permissions.clear(); diff --git a/modules/commands/gl_global.cpp b/modules/commands/gl_global.cpp index 3cd707b38..d8a414fde 100644 --- a/modules/commands/gl_global.cpp +++ b/modules/commands/gl_global.cpp @@ -22,7 +22,7 @@ class CommandGLGlobal : public Command this->SetSyntax(_("\037message\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 &msg = params[0]; @@ -35,7 +35,7 @@ class CommandGLGlobal : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { Reference<BotInfo> sender; if (GService) diff --git a/modules/commands/greet.cpp b/modules/commands/greet.cpp index 0fa66fe5d..a75c6538e 100644 --- a/modules/commands/greet.cpp +++ b/modules/commands/greet.cpp @@ -20,7 +20,7 @@ class CommandBSSetGreet : public Command this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); const Anope::string &value = params[1]; @@ -63,7 +63,7 @@ class CommandBSSetGreet : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -119,12 +119,12 @@ class CommandNSSetGreet : public Command } } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params.size() > 0 ? params[0] : ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -145,12 +145,12 @@ class CommandNSSASetGreet : public CommandNSSetGreet this->SetSyntax(_("\037nickname\037 \037message\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params.size() > 1 ? params[1] : ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -182,7 +182,7 @@ class Greet : public Module { } - void OnJoinChannel(User *user, Channel *c) anope_override + void OnJoinChannel(User *user, Channel *c) override { /* Only display the greet if the main uplink we're connected * to has synced, or we'll get greet-floods when the net @@ -199,14 +199,14 @@ class Greet : public Module } } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { Anope::string *greet = ns_greet.Get(na->nc); if (greet != NULL) info[_("Greet")] = *greet; } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override { if (bs_greet.HasExt(ci)) info.AddOption(_("Greet")); diff --git a/modules/commands/help.cpp b/modules/commands/help.cpp index e7ab37ff0..c2ed216de 100644 --- a/modules/commands/help.cpp +++ b/modules/commands/help.cpp @@ -34,7 +34,7 @@ class CommandHelp : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { EventReturn MOD_RESULT; FOREACH_RESULT(OnPreHelp, MOD_RESULT, (source, params)); diff --git a/modules/commands/hs_del.cpp b/modules/commands/hs_del.cpp index c07f4bd79..b19a85c4a 100644 --- a/modules/commands/hs_del.cpp +++ b/modules/commands/hs_del.cpp @@ -20,7 +20,7 @@ class CommandHSDel : public Command this->SetSyntax(_("\037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -41,7 +41,7 @@ class CommandHSDel : public Command source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -60,7 +60,7 @@ class CommandHSDelAll : public Command this->SetSyntax(_("\037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -86,7 +86,7 @@ class CommandHSDelAll : public Command source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_group.cpp b/modules/commands/hs_group.cpp index 88ec20568..17dc2dad0 100644 --- a/modules/commands/hs_group.cpp +++ b/modules/commands/hs_group.cpp @@ -13,7 +13,7 @@ class CommandHSGroup : public Command { - bool setting; + bool setting = false; public: void Sync(const NickAlias *na) @@ -37,12 +37,12 @@ class CommandHSGroup : public Command setting = false; } - CommandHSGroup(Module *creator) : Command(creator, "hostserv/group", 0, 0), setting(false) + CommandHSGroup(Module *creator) : Command(creator, "hostserv/group", 0, 0) { this->SetDesc(_("Syncs the vhost for all nicks in a group")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -65,7 +65,7 @@ class CommandHSGroup : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -90,7 +90,7 @@ class HSGroup : public Module throw ModuleException("Your IRCd does not support vhosts"); } - void OnSetVhost(NickAlias *na) anope_override + void OnSetVhost(NickAlias *na) override { if (!synconset) return; @@ -98,7 +98,7 @@ class HSGroup : public Module commandhsgroup.Sync(na); } - void OnNickGroup(User *u, NickAlias *na) anope_override + void OnNickGroup(User *u, NickAlias *na) override { if (!syncongroup) return; @@ -106,7 +106,7 @@ class HSGroup : public Module commandhsgroup.Sync(na); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); syncongroup = block->Get<bool>("syncongroup"); diff --git a/modules/commands/hs_list.cpp b/modules/commands/hs_list.cpp index f5de3d9dd..ef4b37402 100644 --- a/modules/commands/hs_list.cpp +++ b/modules/commands/hs_list.cpp @@ -20,7 +20,7 @@ class CommandHSList : public Command this->SetSyntax(_("[\037key\037|\037#X-Y\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 &key = !params.empty() ? params[0] : ""; int from = 0, to = 0, counter = 1; @@ -129,7 +129,7 @@ class CommandHSList : public Command source.Reply(replies[i]); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_off.cpp b/modules/commands/hs_off.cpp index 7c93143ed..f7bf81f6b 100644 --- a/modules/commands/hs_off.cpp +++ b/modules/commands/hs_off.cpp @@ -20,7 +20,7 @@ class CommandHSOff : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); @@ -42,7 +42,7 @@ class CommandHSOff : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_on.cpp b/modules/commands/hs_on.cpp index 8eb1b1d00..44291fffe 100644 --- a/modules/commands/hs_on.cpp +++ b/modules/commands/hs_on.cpp @@ -20,7 +20,7 @@ class CommandHSOn : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!IRCD->CanSetVHost) return; // HostServ wouldn't even be loaded at this point @@ -48,7 +48,7 @@ class CommandHSOn : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index 5bf10eb7f..8a02ea7d1 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -29,7 +29,7 @@ struct HostRequest : Serializable HostRequest(Extensible *) : Serializable("HostRequest") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["nick"] << this->nick; data["ident"] << this->ident; @@ -79,7 +79,7 @@ class CommandHSRequest : public Command this->SetSyntax(_("vhost")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -172,7 +172,7 @@ class CommandHSRequest : public Command Log(LOG_COMMAND, source, this) << "to request new vhost " << (!user.empty() ? user + "@" : "") << host; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -192,7 +192,7 @@ class CommandHSActivate : public Command this->SetSyntax(_("\037nick\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -220,7 +220,7 @@ class CommandHSActivate : public Command source.Reply(_("No request for nick %s found."), nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -241,7 +241,7 @@ class CommandHSReject : public Command this->SetSyntax(_("\037nick\037 [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -276,7 +276,7 @@ class CommandHSReject : public Command source.Reply(_("No request for nick %s found."), nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -296,7 +296,7 @@ class CommandHSWaiting : public Command this->SetDesc(_("Retrieves the vhost requests")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { unsigned counter = 0; unsigned display_counter = 0, listmax = Config->GetModule(this->owner)->Get<unsigned>("listmax"); @@ -337,7 +337,7 @@ class CommandHSWaiting : public Command source.Reply(_("Displayed \002%d\002 records (\002%d\002 total)."), display_counter, counter); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/hs_set.cpp b/modules/commands/hs_set.cpp index 090b5e2e5..8f56333c4 100644 --- a/modules/commands/hs_set.cpp +++ b/modules/commands/hs_set.cpp @@ -20,7 +20,7 @@ class CommandHSSet : public Command this->SetSyntax(_("\037nick\037 \037hostmask\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -92,7 +92,7 @@ class CommandHSSet : public Command source.Reply(_("VHost for \002%s\002 set to \002%s\002."), nick.c_str(), host.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -126,7 +126,7 @@ class CommandHSSetAll : public Command this->SetSyntax(_("\037nick\037 \037hostmask\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -199,7 +199,7 @@ class CommandHSSetAll : public Command source.Reply(_("VHost for group \002%s\002 set to \002%s\002."), nick.c_str(), host.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_cancel.cpp b/modules/commands/ms_cancel.cpp index e5d217bf9..ceba02aa8 100644 --- a/modules/commands/ms_cancel.cpp +++ b/modules/commands/ms_cancel.cpp @@ -20,7 +20,7 @@ class CommandMSCancel : public Command this->SetSyntax(_("{\037nick\037 | \037channel\037}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -77,7 +77,7 @@ class CommandMSCancel : public Command source.Reply(_("No memo was cancelable.")); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_check.cpp b/modules/commands/ms_check.cpp index c90b8c2f0..dafc0af03 100644 --- a/modules/commands/ms_check.cpp +++ b/modules/commands/ms_check.cpp @@ -20,7 +20,7 @@ class CommandMSCheck : public Command this->SetSyntax(_("\037nick\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 &recipient = params[0]; @@ -62,7 +62,7 @@ class CommandMSCheck : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp index 4ca12b159..ff9596c30 100644 --- a/modules/commands/ms_del.cpp +++ b/modules/commands/ms_del.cpp @@ -22,7 +22,7 @@ class MemoDelCallback : public NumberList { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > mi->memos->size()) return; @@ -45,7 +45,7 @@ class CommandMSDel : public Command this->SetSyntax(_("[\037channel\037] {\037num\037 | \037list\037 | LAST | ALL}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -122,7 +122,7 @@ class CommandMSDel : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_ignore.cpp b/modules/commands/ms_ignore.cpp index 9a9796fe1..8e0f1de9e 100644 --- a/modules/commands/ms_ignore.cpp +++ b/modules/commands/ms_ignore.cpp @@ -22,7 +22,7 @@ class CommandMSIgnore : public Command this->SetSyntax(_("[\037channel\037] LIST")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -106,7 +106,7 @@ class CommandMSIgnore : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_info.cpp b/modules/commands/ms_info.cpp index 2df0f2c5d..eb9b785d1 100644 --- a/modules/commands/ms_info.cpp +++ b/modules/commands/ms_info.cpp @@ -20,7 +20,7 @@ class CommandMSInfo : public Command this->SetSyntax(_("[\037nick\037 | \037channel\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { NickCore *nc = source.nc; const MemoInfo *mi; @@ -197,7 +197,7 @@ class CommandMSInfo : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_list.cpp b/modules/commands/ms_list.cpp index 87dc6a81f..b09c579dd 100644 --- a/modules/commands/ms_list.cpp +++ b/modules/commands/ms_list.cpp @@ -20,7 +20,7 @@ class CommandMSList : public Command this->SetSyntax(_("[\037channel\037] [\037list\037 | NEW]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string param = !params.empty() ? params[0] : "", chan; @@ -75,7 +75,7 @@ class CommandMSList : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > mi->memos->size()) return; @@ -135,7 +135,7 @@ class CommandMSList : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_read.cpp b/modules/commands/ms_read.cpp index 9ba49684d..7f0cba722 100644 --- a/modules/commands/ms_read.cpp +++ b/modules/commands/ms_read.cpp @@ -65,7 +65,7 @@ class MemoListCallback : public NumberList source.Reply(_("No memos to display.")); } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number || number > mi->memos->size()) return; @@ -113,7 +113,7 @@ class CommandMSRead : public Command this->SetSyntax(_("[\037channel\037] {\037num\037 | \037list\037 | LAST | NEW | ALL}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { MemoInfo *mi; @@ -192,7 +192,7 @@ class CommandMSRead : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_rsend.cpp b/modules/commands/ms_rsend.cpp index 68b7bebc5..eaeea00bd 100644 --- a/modules/commands/ms_rsend.cpp +++ b/modules/commands/ms_rsend.cpp @@ -25,7 +25,7 @@ class CommandMSRSend : public Command this->SetSyntax(_("{\037nick\037 | \037channel\037} \037memo-text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!memoserv) return; @@ -73,7 +73,7 @@ class CommandMSRSend : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp index 83e8494f4..0e20af065 100644 --- a/modules/commands/ms_send.cpp +++ b/modules/commands/ms_send.cpp @@ -25,7 +25,7 @@ class CommandMSSend : public Command this->SetSyntax(_("{\037nick\037 | \037channel\037} \037memo-text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!memoserv) return; @@ -59,7 +59,7 @@ class CommandMSSend : public Command source.Reply(_("Sorry, %s currently has too many memos and cannot receive more."), nick.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_sendall.cpp b/modules/commands/ms_sendall.cpp index a5b575321..efe9c7689 100644 --- a/modules/commands/ms_sendall.cpp +++ b/modules/commands/ms_sendall.cpp @@ -25,7 +25,7 @@ class CommandMSSendAll : public Command this->SetSyntax(_("\037memo-text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!memoserv) return; @@ -45,7 +45,7 @@ class CommandMSSendAll : public Command source.Reply(_("A massmemo has been sent to all registered users.")); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ms_set.cpp b/modules/commands/ms_set.cpp index 1c020817f..56a8da09a 100644 --- a/modules/commands/ms_set.cpp +++ b/modules/commands/ms_set.cpp @@ -207,7 +207,7 @@ class CommandMSSet : public Command this->SetSyntax(_("\037option\037 \037parameters\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 &cmd = params[0]; MemoInfo *mi = &source.nc->memos; @@ -226,7 +226,7 @@ class CommandMSSet : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (subcommand.empty()) { diff --git a/modules/commands/ms_staff.cpp b/modules/commands/ms_staff.cpp index bdf504ba3..774971c69 100644 --- a/modules/commands/ms_staff.cpp +++ b/modules/commands/ms_staff.cpp @@ -25,7 +25,7 @@ class CommandMSStaff : public Command this->SetSyntax(_("\037memo-text\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!memoserv) return; @@ -41,7 +41,7 @@ class CommandMSStaff : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_access.cpp b/modules/commands/ns_access.cpp index c04e359a4..743616d9f 100644 --- a/modules/commands/ns_access.cpp +++ b/modules/commands/ns_access.cpp @@ -104,7 +104,7 @@ class CommandNSAccess : public Command this->SetSyntax(_("LIST [\037nickname\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 &cmd = params[0]; Anope::string nick, mask; @@ -159,7 +159,7 @@ class CommandNSAccess : public Command 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(" "); @@ -196,7 +196,7 @@ class NSAccess : public Module { } - void OnNickRegister(User *u, NickAlias *na, const Anope::string &) anope_override + void OnNickRegister(User *u, NickAlias *na, const Anope::string &) override { if (u && Config->GetModule(this)->Get<bool>("addaccessonreg")) na->nc->AddAccess(u->Mask()); diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 4f4c75e1a..1f48dfb68 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -38,7 +38,7 @@ struct AJoinEntry : Serializable } } - void Serialize(Serialize::Data &sd) const anope_override + void Serialize(Serialize::Data &sd) const override { if (!this->owner) return; @@ -233,7 +233,7 @@ class CommandNSAJoin : public Command this->SetSyntax(_("LIST [\037nickname\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 &cmd = params[0]; Anope::string nick, param, param2; @@ -285,7 +285,7 @@ class CommandNSAJoin : public Command 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(" "); @@ -314,7 +314,7 @@ class NSAJoin : public Module } - void OnUserLogin(User *u) anope_override + void OnUserLogin(User *u) override { BotInfo *NickServ = Config->GetClient("NickServ"); if (!NickServ) @@ -356,7 +356,7 @@ class NSAJoin : public Module continue; else if (c->HasMode("ADMINONLY") && !u->HasMode("ADMIN")) continue; - else if (c->HasMode("SSL") && !(u->HasMode("SSL") || u->HasExt("ssl"))) + else if (c->HasMode("SSL") && !u->IsSecurelyConnected()) continue; else if (c->MatchesList(u, "BAN") == true && c->MatchesList(u, "EXCEPT") == false) need_invite = true; diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp index 35c4d5579..c6e485d2c 100644 --- a/modules/commands/ns_alist.cpp +++ b/modules/commands/ns_alist.cpp @@ -25,7 +25,7 @@ class CommandNSAList : public Command this->SetSyntax(_("[\037nickname\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string nick = source.GetNick(); NickCore *nc = source.nc; @@ -120,7 +120,7 @@ class CommandNSAList : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index fec857109..328216de6 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -18,7 +18,7 @@ struct CertServiceImpl : CertService { CertServiceImpl(Module *o) : CertService(o) { } - NickCore* FindAccountFromCert(const Anope::string &cert) anope_override + NickCore* FindAccountFromCert(const Anope::string &cert) override { Anope::hash_map<NickCore *>::iterator it = certmap.find(cert); if (it != certmap.end()) @@ -46,7 +46,7 @@ struct NSCertListImpl : NSCertList * * Adds a new entry into the cert list. */ - void AddCert(const Anope::string &entry) anope_override + void AddCert(const Anope::string &entry) override { this->certs.push_back(entry); certmap[entry] = nc; @@ -60,14 +60,14 @@ struct NSCertListImpl : NSCertList * * Retrieves an entry from the certificate list corresponding to the given index. */ - Anope::string GetCert(unsigned entry) const anope_override + Anope::string GetCert(unsigned entry) const override { if (entry >= this->certs.size()) return ""; return this->certs[entry]; } - unsigned GetCertCount() const anope_override + unsigned GetCertCount() const override { return this->certs.size(); } @@ -79,7 +79,7 @@ struct NSCertListImpl : NSCertList * * Search for an fingerprint within the cert list. */ - bool FindCert(const Anope::string &entry) const anope_override + bool FindCert(const Anope::string &entry) const override { return std::find(this->certs.begin(), this->certs.end(), entry) != this->certs.end(); } @@ -90,7 +90,7 @@ struct NSCertListImpl : NSCertList * * Removes the specified fingerprint from the cert list. */ - void EraseCert(const Anope::string &entry) anope_override + void EraseCert(const Anope::string &entry) override { std::vector<Anope::string>::iterator it = std::find(this->certs.begin(), this->certs.end(), entry); if (it != this->certs.end()) @@ -105,7 +105,7 @@ struct NSCertListImpl : NSCertList * * Deletes all the memory allocated in the certificate list vector and then clears the vector. */ - void ClearCert() anope_override + void ClearCert() override { FOREACH_MOD(OnNickClearCert, (this->nc)); for (unsigned i = 0; i < certs.size(); ++i) @@ -113,7 +113,7 @@ struct NSCertListImpl : NSCertList this->certs.clear(); } - void Check() anope_override + void Check() override { if (this->certs.empty()) nc->Shrink<NSCertList>("certificates"); @@ -123,7 +123,7 @@ struct NSCertListImpl : NSCertList { ExtensibleItem(Module *m, const Anope::string &ename) : ::ExtensibleItem<NSCertListImpl>(m, ename) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { if (s->GetSerializableType()->GetName() != "NickCore") return; @@ -137,7 +137,7 @@ struct NSCertListImpl : NSCertList data["cert"] << c->GetCert(i) << " "; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { if (s->GetSerializableType()->GetName() != "NickCore") return; @@ -260,7 +260,7 @@ class CommandNSCert : public Command this->SetSyntax(_("LIST [\037nickname\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 &cmd = params[0]; Anope::string nick, certfp; @@ -312,7 +312,7 @@ class CommandNSCert : public Command 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(" "); @@ -352,7 +352,7 @@ class NSCert : public Module throw ModuleException("Your IRCd does not support ssl client certificates"); } - void OnFingerprint(User *u) anope_override + void OnFingerprint(User *u) override { BotInfo *NickServ = Config->GetClient("NickServ"); if (!NickServ || u->IsIdentified()) @@ -379,7 +379,7 @@ class NSCert : public Module Log(NickServ) << u->GetMask() << " automatically identified for account " << nc->display << " via SSL certificate fingerprint"; } - EventReturn OnNickValidate(User *u, NickAlias *na) anope_override + EventReturn OnNickValidate(User *u, NickAlias *na) override { NSCertList *cl = certs.Get(na->nc); if (!u->fingerprint.empty() && cl && cl->FindCert(u->fingerprint)) diff --git a/modules/commands/ns_drop.cpp b/modules/commands/ns_drop.cpp index cb71d973d..4ee558ba0 100644 --- a/modules/commands/ns_drop.cpp +++ b/modules/commands/ns_drop.cpp @@ -20,7 +20,7 @@ class CommandNSDrop : public Command this->SetDesc(_("Cancel the registration of a nickname")); } - 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 &nick = params[0]; @@ -54,7 +54,7 @@ class CommandNSDrop : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_getemail.cpp b/modules/commands/ns_getemail.cpp index 23f9561f2..85e977d6d 100644 --- a/modules/commands/ns_getemail.cpp +++ b/modules/commands/ns_getemail.cpp @@ -24,7 +24,7 @@ class CommandNSGetEMail : public Command this->SetSyntax(_("\037email\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 &email = params[0]; int j = 0; @@ -51,7 +51,7 @@ class CommandNSGetEMail : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_getpass.cpp b/modules/commands/ns_getpass.cpp deleted file mode 100644 index 48db02853..000000000 --- a/modules/commands/ns_getpass.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* NickServ core functions - * - * (C) 2003-2021 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -#include "module.h" - -class CommandNSGetPass : public Command -{ - public: - CommandNSGetPass(Module *creator) : Command(creator, "nickserv/getpass", 1, 1) - { - this->SetDesc(_("Retrieve the password for a nickname")); - this->SetSyntax(_("\037nickname\037")); - } - - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override - { - const Anope::string &nick = params[0]; - Anope::string tmp_pass; - const NickAlias *na; - - if (!(na = NickAlias::Find(nick))) - source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); - else if (Config->GetModule("nickserv")->Get<bool>("secureadmins", "yes") && na->nc->IsServicesOper()) - source.Reply(_("You may not get the password of other Services Operators.")); - else - { - if (Anope::Decrypt(na->nc->pass, tmp_pass) == 1) - { - Log(LOG_ADMIN, source, this) << "for " << nick; - source.Reply(_("Password for %s is \002%s\002."), nick.c_str(), tmp_pass.c_str()); - } - else - source.Reply(_("GETPASS command unavailable because encryption is in use.")); - } - return; - } - - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override - { - this->SendSyntax(source); - source.Reply(" "); - source.Reply(_("Returns the password for the given nickname. \002Note\002 that\n" - "whenever this command is used, a message including the\n" - "person who issued the command and the nickname it was used\n" - "on will be logged and sent out as a WALLOPS/GLOBOPS.")); - return true; - } -}; - -class NSGetPass : public Module -{ - CommandNSGetPass commandnsgetpass; - - public: - NSGetPass(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), - commandnsgetpass(this) - { - - Anope::string tmp_pass = "plain:tmp"; - if (!Anope::Decrypt(tmp_pass, tmp_pass)) - throw ModuleException("Incompatible with the encryption module being used"); - - } -}; - -MODULE_INIT(NSGetPass) diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index aa2865776..bd26f5a36 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -22,7 +22,7 @@ class NSGroupRequest : public IdentifyRequest public: NSGroupRequest(Module *o, CommandSource &src, Command *c, const Anope::string &n, NickAlias *targ, const Anope::string &pass) : IdentifyRequest(o, targ->nc->display, pass), source(src), cmd(c), nick(n), target(targ) { } - void OnSuccess() anope_override + void OnSuccess() override { User *u = source.GetUser(); @@ -67,7 +67,7 @@ class NSGroupRequest : public IdentifyRequest u->lastnickreg = Anope::CurTime; } - void OnFail() anope_override + void OnFail() override { User *u = source.GetUser(); @@ -93,7 +93,7 @@ class CommandNSGroup : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *user = source.GetUser(); @@ -194,7 +194,7 @@ class CommandNSGroup : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -237,7 +237,7 @@ class CommandNSUngroup : public Command this->SetSyntax(_("[\037nick\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string nick = !params.empty() ? params[0] : ""; NickAlias *na = NickAlias::Find(!nick.empty() ? nick : source.GetNick()); @@ -278,7 +278,7 @@ class CommandNSUngroup : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -299,7 +299,7 @@ class CommandNSGList : public Command this->SetDesc(_("Lists all nicknames in your group")); } - 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 &nick = !params.empty() ? params[0] : ""; const NickCore *nc; @@ -325,7 +325,7 @@ class CommandNSGList : public Command ListFormatter list(source.GetAccount()); list.AddColumn(_("Nick")).AddColumn(_("Expires")); - time_t nickserv_expire = Config->GetModule("nickserv")->Get<time_t>("expire", "21d"), + time_t nickserv_expire = Config->GetModule("nickserv")->Get<time_t>("expire", "90d"), unconfirmed_expire = Config->GetModule("ns_register")->Get<time_t>("unconfirmedexpire", "1d"); for (unsigned i = 0; i < nc->aliases->size(); ++i) { @@ -357,7 +357,7 @@ class CommandNSGList : public Command source.Reply(_("%d nickname(s) in the group."), nc->aliases->size()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (source.IsServicesOper()) source.Reply(_("Syntax: \002%s [\037nickname\037]\002\n" diff --git a/modules/commands/ns_identify.cpp b/modules/commands/ns_identify.cpp index b0adf6388..61da680fa 100644 --- a/modules/commands/ns_identify.cpp +++ b/modules/commands/ns_identify.cpp @@ -19,7 +19,7 @@ class NSIdentifyRequest : public IdentifyRequest public: NSIdentifyRequest(Module *o, CommandSource &s, Command *c, const Anope::string &acc, const Anope::string &pass) : IdentifyRequest(o, acc, pass), source(s), cmd(c) { } - void OnSuccess() anope_override + void OnSuccess() override { if (!source.GetUser()) return; @@ -40,7 +40,7 @@ class NSIdentifyRequest : public IdentifyRequest } } - void OnFail() anope_override + void OnFail() override { if (source.GetUser()) { @@ -68,7 +68,7 @@ class CommandNSIdentify : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); @@ -100,7 +100,7 @@ class CommandNSIdentify : public Command req->Dispatch(); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index 018872b7d..a4ea5a3c1 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -21,7 +21,7 @@ class CommandNSInfo : public Command this->AllowUnregistered(true); } - 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 &nick = params.size() ? params[0] : (source.nc ? source.nc->display : source.GetNick()); @@ -119,7 +119,7 @@ class CommandNSInfo : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -212,12 +212,12 @@ class CommandNSSetHide : public Command this->OnSyntaxError(source, "HIDE"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -240,13 +240,13 @@ class CommandNSSASetHide : public CommandNSSetHide this->SetSyntax(_("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->ClearSyntax(); this->Run(source, params[0], params[1], params[2]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index e08b217f9..407d15d8e 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -20,7 +20,7 @@ class CommandNSList : public Command this->SetSyntax(_("\037pattern\037 [SUSPENDED] [NOEXPIRE] [UNCONFIRMED]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string pattern = params[0]; @@ -132,7 +132,7 @@ class CommandNSList : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -224,12 +224,12 @@ class CommandNSSetPrivate : public Command this->OnSyntaxError(source, "PRIVATE"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -252,12 +252,12 @@ class CommandNSSASetPrivate : public CommandNSSetPrivate this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -288,7 +288,7 @@ class NSList : public Module { } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_all) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_all) override { if (!show_all) return; diff --git a/modules/commands/ns_logout.cpp b/modules/commands/ns_logout.cpp index f9a0f2d03..dc441cfec 100644 --- a/modules/commands/ns_logout.cpp +++ b/modules/commands/ns_logout.cpp @@ -22,7 +22,7 @@ class CommandNSLogout : public Command this->SetSyntax(_("[\037nickname\037 [REVALIDATE]]")); } - 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 &nick = !params.empty() ? params[0] : ""; @@ -59,7 +59,7 @@ class CommandNSLogout : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index aa4f0de94..e6600506f 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -32,7 +32,7 @@ class NSRecoverRequest : public IdentifyRequest public: NSRecoverRequest(Module *o, CommandSource &src, Command *c, const Anope::string &nick, const Anope::string &pass) : IdentifyRequest(o, nick, pass), source(src), cmd(c), user(nick) { } - void OnSuccess() anope_override + void OnSuccess() override { User *u = User::Find(user, true); if (!source.GetUser() || !source.service) @@ -124,7 +124,7 @@ class NSRecoverRequest : public IdentifyRequest } } - void OnFail() anope_override + void OnFail() override { if (NickAlias::Find(GetAccount()) != NULL) { @@ -151,7 +151,7 @@ class CommandNSRecover : public Command this->AllowUnregistered(true); } - 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 &nick = params[0]; const Anope::string &pass = params.size() > 1 ? params[1] : ""; @@ -207,7 +207,7 @@ class CommandNSRecover : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -237,7 +237,7 @@ class NSRecover : public Module } - void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override + void OnUserNickChange(User *u, const Anope::string &oldnick) override { if (Config->GetModule(this)->Get<bool>("restoreonrecover")) { @@ -272,7 +272,7 @@ class NSRecover : public Module } } - void OnJoinChannel(User *u, Channel *c) anope_override + void OnJoinChannel(User *u, Channel *c) override { if (Config->GetModule(this)->Get<bool>("restoreonrecover")) { diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index 4ff4cca44..2e9f08aeb 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -23,7 +23,7 @@ class CommandNSConfirm : public Command this->AllowUnregistered(true); } - 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 &passcode = params[0]; @@ -88,7 +88,7 @@ class CommandNSConfirm : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -106,7 +106,7 @@ class CommandNSConfirm : public Command return true; } - void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) anope_override + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) override { source.Reply(NICK_CONFIRM_INVALID); } @@ -125,7 +125,7 @@ class CommandNSRegister : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); Anope::string u_nick = source.GetNick(); @@ -192,7 +192,8 @@ class CommandNSRegister : public Command } } - unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32"); + unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "8"); + unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32"); if (Config->GetModule("nickserv")->Get<bool>("forceemail", "yes") && email.empty()) this->OnSyntaxError(source, ""); @@ -200,10 +201,12 @@ class CommandNSRegister : public Command source.Reply(_("Please wait %d seconds before using the REGISTER command again."), (u->lastnickreg + reg_delay) - Anope::CurTime); else if (NickAlias::Find(u_nick) != NULL) source.Reply(NICK_ALREADY_REGISTERED, u_nick.c_str()); - else if (pass.equals_ci(u_nick) || (Config->GetBlock("options")->Get<bool>("strictpasswords") && pass.length() < 5)) + else if (pass.equals_ci(u_nick)) source.Reply(MORE_OBSCURE_PASSWORD); - else if (pass.length() > passlen) - source.Reply(PASSWORD_TOO_LONG, passlen); + else if (pass.length() < minpasslen) + source.Reply(PASSWORD_TOO_SHORT, minpasslen); + else if (pass.length() > maxpasslen) + source.Reply(PASSWORD_TOO_LONG, maxpasslen); else if (!email.empty() && !Mail::Validate(email)) source.Reply(MAIL_X_INVALID, email.c_str()); else @@ -229,10 +232,6 @@ class CommandNSRegister : public Command else source.Reply(_("Nickname \002%s\002 registered."), u_nick.c_str()); - Anope::string tmp_pass; - if (Anope::Decrypt(na->nc->pass, tmp_pass) == 1) - source.Reply(_("Your password is \002%s\002 - remember this for later use."), tmp_pass.c_str()); - if (nsregister.equals_ci("admin")) { nc->Extend<bool>("UNCONFIRMED"); @@ -264,7 +263,7 @@ class CommandNSRegister : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -314,7 +313,7 @@ class CommandNSResend : public Command this->SetDesc(_("Resend registration confirmation email")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) { @@ -345,7 +344,7 @@ class CommandNSResend : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) return false; @@ -356,7 +355,7 @@ class CommandNSResend : public Command return true; } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { if (Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) Command::OnServHelp(source); @@ -381,7 +380,7 @@ class NSRegister : public Module throw ModuleException("Module " + this->name + " will not load with registration disabled."); } - void OnNickIdentify(User *u) anope_override + void OnNickIdentify(User *u) override { BotInfo *NickServ; if (unconfirmed.HasExt(u->Account()) && (NickServ = Config->GetClient("NickServ"))) @@ -399,7 +398,7 @@ class NSRegister : public Module } } - void OnPreNickExpire(NickAlias *na, bool &expire) anope_override + void OnPreNickExpire(NickAlias *na, bool &expire) override { if (unconfirmed.HasExt(na->nc)) { diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index f6cd211fa..6ca5e55fb 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -23,7 +23,7 @@ class CommandNSResetPass : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const NickAlias *na; @@ -43,7 +43,7 @@ class CommandNSResetPass : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -73,7 +73,7 @@ class NSResetPass : public Module throw ModuleException("Not using mail."); } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (command->name == "nickserv/confirm" && params.size() > 1) { diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index d2ff6dece..e96a0e06c 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -20,13 +20,13 @@ class CommandNSSet : public Command this->SetSyntax(_("\037option\037 \037parameters\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->OnSyntaxError(source, ""); return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -75,13 +75,13 @@ class CommandNSSASet : public Command this->SetSyntax(_("\037option\037 \037nickname\037 \037parameters\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->OnSyntaxError(source, ""); return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -120,7 +120,7 @@ class CommandNSSetPassword : public Command this->SetSyntax(_("\037new-password\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 ¶m = params[0]; unsigned len = param.length(); @@ -131,30 +131,33 @@ class CommandNSSetPassword : public Command return; } - if (source.GetNick().equals_ci(param) || (Config->GetBlock("options")->Get<bool>("strictpasswords") && len < 5)) + if (source.GetNick().equals_ci(param)) { source.Reply(MORE_OBSCURE_PASSWORD); return; } - unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32"); - if (len > passlen) + unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "8"); + if (len < minpasslen) { - source.Reply(PASSWORD_TOO_LONG, passlen); + source.Reply(PASSWORD_TOO_SHORT, minpasslen); + return; + } + + unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32"); + if (len > maxpasslen) + { + source.Reply(PASSWORD_TOO_LONG, maxpasslen); return; } Log(LOG_COMMAND, source, this) << "to change their password"; Anope::Encrypt(param, source.nc->pass); - Anope::string tmp_pass; - if (Anope::Decrypt(source.nc->pass, tmp_pass) == 1) - source.Reply(_("Password for \002%s\002 changed to \002%s\002."), source.nc->display.c_str(), tmp_pass.c_str()); - else - source.Reply(_("Password for \002%s\002 changed."), source.nc->display.c_str()); + source.Reply(_("Password for \002%s\002 changed."), source.nc->display.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -173,7 +176,7 @@ class CommandNSSASetPassword : public Command this->SetSyntax(_("\037nickname\037 \037new-password\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -197,16 +200,23 @@ class CommandNSSASetPassword : public Command return; } - if (nc->display.equals_ci(params[1]) || (Config->GetBlock("options")->Get<bool>("strictpasswords") && len < 5)) + if (nc->display.equals_ci(params[1])) { source.Reply(MORE_OBSCURE_PASSWORD); return; } - unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32"); - if (len > passlen) + unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "8"); + if (len < minpasslen) { - source.Reply(PASSWORD_TOO_LONG, passlen); + source.Reply(PASSWORD_TOO_SHORT, minpasslen); + return; + } + + unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32"); + if (len > maxpasslen) + { + source.Reply(PASSWORD_TOO_LONG, maxpasslen); return; } @@ -214,13 +224,10 @@ class CommandNSSASetPassword : public Command Anope::Encrypt(params[1], nc->pass); Anope::string tmp_pass; - if (Anope::Decrypt(nc->pass, tmp_pass) == 1) - source.Reply(_("Password for \002%s\002 changed to \002%s\002."), nc->display.c_str(), tmp_pass.c_str()); - else - source.Reply(_("Password for \002%s\002 changed."), nc->display.c_str()); + source.Reply(_("Password for \002%s\002 changed."), nc->display.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -275,12 +282,12 @@ class CommandNSSetAutoOp : public Command this->OnSyntaxError(source, "AUTOOP"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { BotInfo *bi = Config->GetClient("ChanServ"); this->SendSyntax(source); @@ -302,12 +309,12 @@ class CommandNSSASetAutoOp : public CommandNSSetAutoOp this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { BotInfo *bi = Config->GetClient("ChanServ"); this->SendSyntax(source); @@ -375,12 +382,12 @@ class CommandNSSetDisplay : public Command source.Reply(NICK_SET_DISPLAY_CHANGED, user_na->nc->display.c_str()); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -399,12 +406,12 @@ class CommandNSSASetDisplay : public CommandNSSetDisplay this->SetSyntax(_("\037nickname\037 \037new-display\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -521,12 +528,12 @@ class CommandNSSetEmail : public Command } } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params.size() ? params[0] : ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -546,12 +553,12 @@ class CommandNSSASetEmail : public CommandNSSetEmail this->SetSyntax(_("\037nickname\037 \037address\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params.size() > 1 ? params[1] : ""); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -606,12 +613,12 @@ class CommandNSSetKeepModes : public Command this->OnSyntaxError(source, ""); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -631,12 +638,12 @@ class CommandNSSASetKeepModes : public CommandNSSetKeepModes this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -726,12 +733,12 @@ class CommandNSSetKill : public Command return; } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -760,12 +767,12 @@ class CommandNSSASetKill : public CommandNSSetKill this->SetSyntax(_("\037nickname\037 {ON | QUICK | IMMED | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -836,12 +843,12 @@ class CommandNSSetLanguage : public Command source.Reply(_("Language for \002%s\002 changed to \002%s\002."), nc->display.c_str(), Language::Translate(param.c_str(), _("English"))); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶m) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶m) override { this->Run(source, source.nc->display, param[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -872,12 +879,12 @@ class CommandNSSASetLanguage : public CommandNSSetLanguage this->SetSyntax(_("\037nickname\037 \037language\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -949,12 +956,12 @@ class CommandNSSetMessage : public Command this->OnSyntaxError(source, "MSG"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { Anope::string cmd = source.command; size_t i = cmd.find_last_of(' '); @@ -969,7 +976,7 @@ class CommandNSSetMessage : public Command return true; } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { if (Config->GetBlock("options")->Get<bool>("useprivmsg")) Command::OnServHelp(source); @@ -985,7 +992,7 @@ class CommandNSSASetMessage : public CommandNSSetMessage this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -995,7 +1002,7 @@ class CommandNSSASetMessage : public CommandNSSetMessage return true; } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } @@ -1047,12 +1054,12 @@ class CommandNSSetSecure : public Command this->OnSyntaxError(source, "SECURE"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1076,12 +1083,12 @@ class CommandNSSASetSecure : public CommandNSSetSecure this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1105,7 +1112,7 @@ class CommandNSSASetNoexpire : public Command this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (Anope::ReadOnly) { @@ -1138,7 +1145,7 @@ class CommandNSSASetNoexpire : public Command this->OnSyntaxError(source, "NOEXPIRE"); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -1189,7 +1196,7 @@ class NSSet : public Module { KeepModes(Module *m, const Anope::string &n) : SerializableExtensibleItem<bool>(m, n) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { SerializableExtensibleItem<bool>::ExtensibleSerialize(e, s, data); @@ -1209,7 +1216,7 @@ class NSSet : public Module data["last_modes"] << modes; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { SerializableExtensibleItem<bool>::ExtensibleUnserialize(e, s, data); @@ -1258,7 +1265,7 @@ class NSSet : public Module } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { NickCore *uac = source.nc; @@ -1281,7 +1288,7 @@ class NSSet : public Module return EVENT_CONTINUE; } - void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) anope_override + void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) override { if (chan->ci) { @@ -1290,13 +1297,13 @@ class NSSet : public Module } } - void OnPreNickExpire(NickAlias *na, bool &expire) anope_override + void OnPreNickExpire(NickAlias *na, bool &expire) override { if (noexpire.HasExt(na)) expire = false; } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { if (!show_hidden) return; @@ -1319,19 +1326,19 @@ class NSSet : public Module info.AddOption(_("Keep modes")); } - void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) override { if (u->Account() && setter.GetUser() == u) u->Account()->last_modes = u->GetModeList(); } - void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) override { if (u->Account() && setter.GetUser() == u) u->Account()->last_modes = u->GetModeList(); } - void OnUserLogin(User *u) anope_override + void OnUserLogin(User *u) override { if (keep_modes.HasExt(u->Account())) { diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index a67b6c793..cec4e2e35 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -42,7 +42,7 @@ struct NSMiscData : MiscData, Serializable data = d; } - void Serialize(Serialize::Data &sdata) const anope_override + void Serialize(Serialize::Data &sdata) const override { sdata["nc"] << this->object; sdata["name"] << this->name; @@ -135,12 +135,12 @@ class CommandNSSetMisc : public Command } } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, !params.empty() ? params[0] : ""); } - void OnServHelp(CommandSource &source) anope_override + void OnServHelp(CommandSource &source) override { if (descriptions.count(source.command)) { @@ -149,7 +149,7 @@ class CommandNSSetMisc : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (descriptions.count(source.command)) { @@ -170,7 +170,7 @@ class CommandNSSASetMisc : public CommandNSSetMisc this->SetSyntax(_("\037nickname\037 [\037parameter\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params.size() > 1 ? params[1] : ""); } @@ -195,7 +195,7 @@ class NSSetMisc : public Module delete it->second; } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { descriptions.clear(); @@ -218,7 +218,7 @@ class NSSetMisc : public Module } } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool) override { for (Anope::map<ExtensibleItem<NSMiscData> *>::iterator it = items.begin(); it != items.end(); ++it) { diff --git a/modules/commands/ns_status.cpp b/modules/commands/ns_status.cpp index a64932cca..a819c0013 100644 --- a/modules/commands/ns_status.cpp +++ b/modules/commands/ns_status.cpp @@ -21,7 +21,7 @@ class CommandNSStatus : public Command this->AllowUnregistered(true); } - 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 &nick = !params.empty() ? params[0] : source.GetNick(); const NickAlias *na = NickAlias::Find(nick); @@ -48,7 +48,7 @@ class CommandNSStatus : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index 99a9c03a3..f8d03d7c3 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -18,7 +18,7 @@ struct NSSuspendInfo : SuspendInfo, Serializable { NSSuspendInfo(Extensible *) : Serializable("NSSuspendInfo") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["nick"] << what; data["by"] << by; @@ -61,7 +61,7 @@ class CommandNSSuspend : public Command this->SetSyntax(_("\037nickname\037 [+\037expiry\037] [\037reason\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 &nick = params[0]; @@ -140,7 +140,7 @@ class CommandNSSuspend : public Command FOREACH_MOD(OnNickSuspend, (na)); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -161,7 +161,7 @@ class CommandNSUnSuspend : public Command this->SetSyntax(_("\037nickname\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 &nick = params[0]; @@ -192,7 +192,7 @@ class CommandNSUnSuspend : public Command FOREACH_MOD(OnNickUnsuspended, (na)); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -229,14 +229,14 @@ class NSSuspend : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Anope::string s = conf->GetModule(this)->Get<Anope::string>("show"); commasepstream(s).GetTokens(show); std::transform(show.begin(), show.end(), show.begin(), trim()); } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { NSSuspendInfo *s = suspend.Get(na->nc); if (!s) @@ -254,7 +254,7 @@ class NSSuspend : public Module info[_("Suspension expires")] = Anope::strftime(s->expires, source.GetAccount()); } - void OnPreNickExpire(NickAlias *na, bool &expire) anope_override + void OnPreNickExpire(NickAlias *na, bool &expire) override { NSSuspendInfo *s = suspend.Get(na->nc); if (!s) @@ -274,7 +274,7 @@ class NSSuspend : public Module } } - EventReturn OnNickValidate(User *u, NickAlias *na) anope_override + EventReturn OnNickValidate(User *u, NickAlias *na) override { NSSuspendInfo *s = suspend.Get(na->nc); if (!s) diff --git a/modules/commands/ns_update.cpp b/modules/commands/ns_update.cpp index dbad339cd..ba16dd0ce 100644 --- a/modules/commands/ns_update.cpp +++ b/modules/commands/ns_update.cpp @@ -20,7 +20,7 @@ class CommandNSUpdate : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); NickAlias *na = NickAlias::Find(u->nick); @@ -36,7 +36,7 @@ class CommandNSUpdate : public Command source.Reply(_("Status updated (memos, vhost, chmodes, flags).")); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index e5e22220e..8c82cb55c 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -16,10 +16,10 @@ static ServiceReference<XLineManager> akills("XLineManager", "xlinemanager/sglin class AkillDelCallback : public NumberList { CommandSource &source; - unsigned deleted; + unsigned deleted = 0; Command *cmd; public: - AkillDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), deleted(0), cmd(c) + AkillDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), cmd(c) { } @@ -33,7 +33,7 @@ class AkillDelCallback : public NumberList source.Reply(_("Deleted %d entries from the AKILL list."), deleted); } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number) return; @@ -271,7 +271,7 @@ class CommandOSAKill : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number) return; @@ -390,7 +390,7 @@ class CommandOSAKill : public Command this->SetSyntax("CLEAR"); } - 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 &cmd = params[0]; @@ -413,7 +413,7 @@ class CommandOSAKill : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_chankill.cpp b/modules/commands/os_chankill.cpp index 7795691aa..8c1457f38 100644 --- a/modules/commands/os_chankill.cpp +++ b/modules/commands/os_chankill.cpp @@ -22,7 +22,7 @@ class CommandOSChanKill : public Command this->SetSyntax(_("[+\037expiry\037] \037channel\037 \037reason\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!akills) return; @@ -93,7 +93,7 @@ class CommandOSChanKill : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_config.cpp b/modules/commands/os_config.cpp index 7d4f47f6a..2d3bbf268 100644 --- a/modules/commands/os_config.cpp +++ b/modules/commands/os_config.cpp @@ -20,7 +20,7 @@ class CommandOSConfig : public Command this->SetSyntax(_("{\037MODIFY\037|\037VIEW\037} [\037block name\037 \037item name\037 \037item value\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 &what = params[0]; @@ -57,15 +57,12 @@ class CommandOSConfig : public Command for (unsigned i = 0; !show_blocks[i].empty(); ++i) { Configuration::Block *block = Config->GetBlock(show_blocks[i]); - const Configuration::Block::item_map *items = block->GetItems(); - - if (!items) - continue; + const Configuration::Block::item_map &items = block->GetItems(); ListFormatter lflist(source.GetAccount()); lflist.AddColumn(_("Name")).AddColumn(_("Value")); - for (Configuration::Block::item_map::const_iterator it = items->begin(), it_end = items->end(); it != it_end; ++it) + for (Configuration::Block::item_map::const_iterator it = items.begin(), it_end = items.end(); it != it_end; ++it) { ListFormatter::ListEntry entry; entry["Name"] = it->first; @@ -90,15 +87,15 @@ class CommandOSConfig : public Command for (int i = 0; i < Config->CountBlock("module"); ++i) { Configuration::Block *block = Config->GetBlock("module", i); - const Configuration::Block::item_map *items = block->GetItems(); + const Configuration::Block::item_map &items = block->GetItems(); - if (!items || items->size() <= 1) + if (items.size() <= 1) continue; ListFormatter::ListEntry entry; entry["Module Name"] = block->Get<Anope::string>("name"); - for (Configuration::Block::item_map::const_iterator it = items->begin(), it_end = items->end(); it != it_end; ++it) + for (Configuration::Block::item_map::const_iterator it = items.begin(), it_end = items.end(); it != it_end; ++it) { entry["Name"] = it->first; entry["Value"] = it->second; @@ -120,7 +117,7 @@ class CommandOSConfig : public Command this->OnSyntaxError(source, what); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index 9ed2deb74..cebb979b4 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -120,7 +120,7 @@ class DefConTimeout : public Timer timeout = NULL; } - void Tick(time_t) anope_override + void Tick(time_t) override { if (DConfig.defaultlevel != level) { @@ -177,7 +177,7 @@ class CommandOSDefcon : public Command this->SetSyntax(_("[\0021\002|\0022\002|\0023\002|\0024\002|\0025\002]")); } - 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 &lvl = params[0]; @@ -233,7 +233,7 @@ class CommandOSDefcon : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -335,7 +335,7 @@ class OSDefcon : public Module } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); DefconConfig dconfig; @@ -406,7 +406,7 @@ class OSDefcon : public Module this->ParseModeString(); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) override { if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOff.count(mode->name) && source.GetUser() && !source.GetBot()) { @@ -418,7 +418,7 @@ class OSDefcon : public Module return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string &) anope_override + EventReturn OnChannelModeUnset(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string &) override { if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOn.count(mode->name) && source.GetUser() && !source.GetBot()) { @@ -436,7 +436,7 @@ class OSDefcon : public Module return EVENT_CONTINUE; } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (DConfig.Check(DEFCON_OPER_ONLY) && !source.IsOper()) { @@ -483,7 +483,7 @@ class OSDefcon : public Module return EVENT_CONTINUE; } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (exempt || u->Quitting() || !u->server->IsSynced() || u->server->IsULined()) return; @@ -535,13 +535,13 @@ class OSDefcon : public Module } } - void OnChannelModeAdd(ChannelMode *cm) anope_override + void OnChannelModeAdd(ChannelMode *cm) override { if (DConfig.chanmodes.find(cm->mchar) != Anope::string::npos) this->ParseModeString(); } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (DConfig.Check(DEFCON_FORCE_CHAN_MODES)) c->SetModes(Config->GetClient("OperServ"), false, "%s", DConfig.chanmodes.c_str()); diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index d46e5d972..1a3189d6b 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -36,7 +36,7 @@ struct DNSZone : Serializable zones->erase(it); } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["name"] << name; unsigned count = 0; @@ -89,17 +89,17 @@ class DNSServer : public Serializable { Anope::string server_name; std::vector<Anope::string> ips; - unsigned limit; + unsigned limit = 0; /* wants to be in the pool */ - bool pooled; + bool pooled = false; /* is actually in the pool */ - bool active; + bool active = false; public: std::set<Anope::string, ci::less> zones; - time_t repool; + time_t repool = 0; - DNSServer(const Anope::string &sn) : Serializable("DNSServer"), server_name(sn), limit(0), pooled(false), active(false), repool(0) + DNSServer(const Anope::string &sn) : Serializable("DNSServer"), server_name(sn) { dns_servers->push_back(this); } @@ -139,7 +139,7 @@ class DNSServer : public Serializable } } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["server_name"] << server_name; for (unsigned i = 0; i < ips.size(); ++i) @@ -669,7 +669,7 @@ class CommandOSDNS : public Command this->SetSyntax(_("DEPOOL \037server.name\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params.empty()) this->DisplayPoolState(source); @@ -695,7 +695,7 @@ class CommandOSDNS : public Command 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(" "); @@ -729,15 +729,12 @@ class ModuleDNS : public Module bool remove_split_servers; bool readd_connected_servers; - time_t last_warn; + time_t last_warn = 0; public: ModuleDNS(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), - zone_type("DNSZone", DNSZone::Unserialize), dns_type("DNSServer", DNSServer::Unserialize), commandosdns(this), - last_warn(0) + zone_type("DNSZone", DNSZone::Unserialize), dns_type("DNSServer", DNSServer::Unserialize), commandosdns(this) { - - for (unsigned j = 0; j < dns_servers->size(); ++j) { DNSServer *s = dns_servers->at(j); @@ -754,7 +751,7 @@ class ModuleDNS : public Module delete dns_servers->at(i - 1); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); this->ttl = block->Get<time_t>("ttl"); @@ -765,7 +762,7 @@ class ModuleDNS : public Module this->readd_connected_servers = block->Get<bool>("readd_connected_servers"); } - void OnNewServer(Server *s) anope_override + void OnNewServer(Server *s) override { if (s == Me || s->IsJuped()) return; @@ -780,7 +777,7 @@ class ModuleDNS : public Module } } - void OnServerQuit(Server *s) anope_override + void OnServerQuit(Server *s) override { DNSServer *dns = DNSServer::Find(s->GetName()); if (remove_split_servers && dns && dns->Pooled() && dns->Active()) @@ -793,7 +790,7 @@ class ModuleDNS : public Module } } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (!u->Quitting() && u->server) { @@ -807,7 +804,7 @@ class ModuleDNS : public Module } } - void OnPreUserLogoff(User *u) anope_override + void OnPreUserLogoff(User *u) override { if (u && u->server) { @@ -852,7 +849,7 @@ class ModuleDNS : public Module } } - void OnDnsRequest(DNS::Query &req, DNS::Query *packet) anope_override + void OnDnsRequest(DNS::Query &req, DNS::Query *packet) override { if (req.questions.empty()) return; diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 98182c5c6..a86ba79d8 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -17,7 +17,7 @@ static ServiceReference<NickServService> nickserv("NickServService", "NickServ") struct ForbidDataImpl : ForbidData, Serializable { ForbidDataImpl() : Serializable("ForbidData") { } - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; @@ -75,12 +75,12 @@ class MyForbidService : public ForbidService delete f[i]; } - void AddForbid(ForbidData *d) anope_override + void AddForbid(ForbidData *d) override { this->forbids(d->type).push_back(d); } - void RemoveForbid(ForbidData *d) anope_override + void RemoveForbid(ForbidData *d) override { std::vector<ForbidData *>::iterator it = std::find(this->forbids(d->type).begin(), this->forbids(d->type).end(), d); if (it != this->forbids(d->type).end()) @@ -88,12 +88,12 @@ class MyForbidService : public ForbidService delete d; } - ForbidData *CreateForbid() anope_override + ForbidData *CreateForbid() override { return new ForbidDataImpl(); } - ForbidData *FindForbid(const Anope::string &mask, ForbidType ftype) anope_override + ForbidData *FindForbid(const Anope::string &mask, ForbidType ftype) override { for (unsigned i = this->forbids(ftype).size(); i > 0; --i) { @@ -105,7 +105,7 @@ class MyForbidService : public ForbidService return NULL; } - ForbidData *FindForbidExact(const Anope::string &mask, ForbidType ftype) anope_override + ForbidData *FindForbidExact(const Anope::string &mask, ForbidType ftype) override { for (unsigned i = this->forbids(ftype).size(); i > 0; --i) { @@ -117,7 +117,7 @@ class MyForbidService : public ForbidService return NULL; } - std::vector<ForbidData *> GetForbids() anope_override + std::vector<ForbidData *> GetForbids() override { std::vector<ForbidData *> f; for (unsigned j = FT_NICK; j < FT_SIZE; ++j) @@ -159,7 +159,7 @@ class CommandOSForbid : public Command this->SetSyntax("LIST [NICK|CHAN|EMAIL|REGISTER]"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!this->fs) return; @@ -414,7 +414,7 @@ class CommandOSForbid : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -446,7 +446,7 @@ class OSForbid : public Module } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (u->Quitting() || exempt) return; @@ -454,7 +454,7 @@ class OSForbid : public Module this->OnUserNickChange(u, ""); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { if (u->HasMode("OPER")) return; @@ -472,7 +472,7 @@ class OSForbid : public Module } } - EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override + EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override { BotInfo *OperServ = Config->GetClient("OperServ"); if (u->HasMode("OPER") || !OperServ) @@ -501,7 +501,7 @@ class OSForbid : public Module return EVENT_CONTINUE; } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override { if (command->name == "nickserv/info" && params.size() > 0) { diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index 0887c92b6..0f993c851 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -16,7 +16,7 @@ struct IgnoreDataImpl : IgnoreData, Serializable { IgnoreDataImpl() : Serializable("IgnoreData") { } ~IgnoreDataImpl(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; @@ -64,19 +64,19 @@ class OSIgnoreService : public IgnoreService public: OSIgnoreService(Module *o) : IgnoreService(o), ignores("IgnoreData") { } - void AddIgnore(IgnoreData *ign) anope_override + void AddIgnore(IgnoreData *ign) override { ignores->push_back(ign); } - void DelIgnore(IgnoreData *ign) anope_override + void DelIgnore(IgnoreData *ign) override { std::vector<IgnoreData *>::iterator it = std::find(ignores->begin(), ignores->end(), ign); if (it != ignores->end()) ignores->erase(it); } - void ClearIgnores() anope_override + void ClearIgnores() override { for (unsigned i = ignores->size(); i > 0; --i) { @@ -85,12 +85,12 @@ class OSIgnoreService : public IgnoreService } } - IgnoreData *Create() anope_override + IgnoreData *Create() override { return new IgnoreDataImpl(); } - IgnoreData *Find(const Anope::string &mask) anope_override + IgnoreData *Find(const Anope::string &mask) override { User *u = User::Find(mask, true); std::vector<IgnoreData *>::iterator ign = this->ignores->begin(), ign_end = this->ignores->end(); @@ -148,7 +148,7 @@ class OSIgnoreService : public IgnoreService return NULL; } - std::vector<IgnoreData *> &GetIgnores() anope_override + std::vector<IgnoreData *> &GetIgnores() override { return *ignores; } @@ -345,7 +345,7 @@ class CommandOSIgnore : public Command this->SetSyntax("CLEAR"); } - 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 &cmd = params[0]; @@ -363,7 +363,7 @@ class CommandOSIgnore : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -404,7 +404,7 @@ class OSIgnore : public Module } - EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) anope_override + EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) override { if (!u->HasMode("OPER") && this->osignoreservice.Find(u->nick)) return EVENT_STOP; diff --git a/modules/commands/os_info.cpp b/modules/commands/os_info.cpp index 50eba850c..652d51593 100644 --- a/modules/commands/os_info.cpp +++ b/modules/commands/os_info.cpp @@ -13,15 +13,15 @@ struct OperInfo : Serializable Anope::string target; Anope::string info; Anope::string adder; - time_t created; + time_t created = 0; - OperInfo() : Serializable("OperInfo"), created(0) { } + OperInfo() : Serializable("OperInfo") { } OperInfo(const Anope::string &t, const Anope::string &i, const Anope::string &a, time_t c) : Serializable("OperInfo"), target(t), info(i), adder(a), created(c) { } ~OperInfo(); - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["target"] << target; data["info"] << info; @@ -104,7 +104,7 @@ class CommandOSInfo : public Command this->SetSyntax(_("CLEAR \037target\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 &cmd = params[0], target = params[1], info = params.size() > 2 ? params[2] : ""; @@ -236,7 +236,7 @@ class CommandOSInfo : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -276,12 +276,12 @@ class OSInfo : public Module } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { OnInfo(source, na->nc, info); } - void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) anope_override + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) override { OnInfo(source, ci, info); } diff --git a/modules/commands/os_jupe.cpp b/modules/commands/os_jupe.cpp index 760341389..03ee24424 100644 --- a/modules/commands/os_jupe.cpp +++ b/modules/commands/os_jupe.cpp @@ -20,7 +20,7 @@ class CommandOSJupe : public Command this->SetSyntax(_("\037server\037 [\037reason\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 &jserver = params[0]; const Anope::string &reason = params.size() > 1 ? params[1] : ""; @@ -49,7 +49,7 @@ class CommandOSJupe : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_kick.cpp b/modules/commands/os_kick.cpp index bcb8162bb..79dd0df8f 100644 --- a/modules/commands/os_kick.cpp +++ b/modules/commands/os_kick.cpp @@ -20,7 +20,7 @@ class CommandOSKick : public Command this->SetSyntax(_("\037channel\037 \037user\037 \037reason\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 &chan = params[0]; const Anope::string &nick = params[1]; @@ -55,7 +55,7 @@ class CommandOSKick : public Command Log(LOG_ADMIN, source, this) << "on " << u2->nick << " in " << c->name << " (" << s << ")"; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_kill.cpp b/modules/commands/os_kill.cpp index b8b44dc61..91606d944 100644 --- a/modules/commands/os_kill.cpp +++ b/modules/commands/os_kill.cpp @@ -20,7 +20,7 @@ class CommandOSKill : public Command this->SetSyntax(_("\037user\037 [\037reason\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 &nick = params[0]; Anope::string reason = params.size() > 1 ? params[1] : ""; @@ -41,7 +41,7 @@ class CommandOSKill : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_list.cpp b/modules/commands/os_list.cpp index ec9d35cec..015cbebdc 100644 --- a/modules/commands/os_list.cpp +++ b/modules/commands/os_list.cpp @@ -20,7 +20,7 @@ class CommandOSChanList : public Command this->SetSyntax(_("[{\037pattern\037 | \037nick\037} [\037SECRET\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 &pattern = !params.empty() ? params[0] : ""; const Anope::string &opt = params.size() > 1 ? params[1] : ""; @@ -100,7 +100,7 @@ class CommandOSChanList : public Command source.Reply(_("End of channel list. \002%u\002 channels shown."), count); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -133,7 +133,7 @@ class CommandOSUserList : public Command this->SetSyntax(_("[{\037pattern\037 | \037channel\037} [\037INVISIBLE\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 &pattern = !params.empty() ? params[0] : ""; const Anope::string &opt = params.size() > 1 ? params[1] : ""; @@ -236,7 +236,7 @@ class CommandOSUserList : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_login.cpp b/modules/commands/os_login.cpp index 3b8f46f83..2d72cd01c 100644 --- a/modules/commands/os_login.cpp +++ b/modules/commands/os_login.cpp @@ -20,7 +20,7 @@ class CommandOSLogin : public Command this->RequireUser(true); } - 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 &password = params[0]; @@ -45,7 +45,7 @@ class CommandOSLogin : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -55,7 +55,7 @@ class CommandOSLogin : public Command return true; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Login to %s")), source.service->nick.c_str()); } @@ -69,7 +69,7 @@ class CommandOSLogout : public Command this->RequireUser(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *u = source.GetUser(); Oper *o = source.nc->o; @@ -87,7 +87,7 @@ class CommandOSLogout : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -97,7 +97,7 @@ class CommandOSLogout : public Command return true; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Logout from %s")), source.service->nick.c_str()); } @@ -116,7 +116,7 @@ class OSLogin : public Module } - EventReturn IsServicesOper(User *u) anope_override + EventReturn IsServicesOper(User *u) override { if (!u->Account()->o->password.empty()) { diff --git a/modules/commands/os_logsearch.cpp b/modules/commands/os_logsearch.cpp index fa958ad08..a4c4829a2 100644 --- a/modules/commands/os_logsearch.cpp +++ b/modules/commands/os_logsearch.cpp @@ -33,7 +33,7 @@ class CommandOSLogSearch : public Command this->SetSyntax(_("[+\037days\037d] [+\037limit\037l] \037pattern\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { int days = 7, replies = 50; @@ -152,7 +152,7 @@ class CommandOSLogSearch : public Command source.Reply(_("Showed %d/%d matches for \002%s\002."), matches.size(), found, search_string.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_mode.cpp b/modules/commands/os_mode.cpp index 2fa46e0ad..3ae3d2f50 100644 --- a/modules/commands/os_mode.cpp +++ b/modules/commands/os_mode.cpp @@ -21,7 +21,7 @@ class CommandOSMode : public Command this->SetSyntax(_("\037channel\037 CLEAR [ALL]")); } - 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 &target = params[0]; const Anope::string &modes = params[1]; @@ -126,7 +126,7 @@ class CommandOSMode : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -147,7 +147,7 @@ class CommandOSUMode : public Command this->SetSyntax(_("\037user\037 \037modes\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 &target = params[0]; const Anope::string &modes = params[1]; @@ -166,7 +166,7 @@ class CommandOSUMode : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_modinfo.cpp b/modules/commands/os_modinfo.cpp index 9d7ac563b..85650cb2e 100644 --- a/modules/commands/os_modinfo.cpp +++ b/modules/commands/os_modinfo.cpp @@ -20,7 +20,7 @@ class CommandOSModInfo : public Command this->SetSyntax(_("\037modname\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 &file = params[0]; @@ -63,7 +63,7 @@ class CommandOSModInfo : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -81,7 +81,7 @@ class CommandOSModList : public Command this->SetSyntax("[all|third|vendor|extra|database|encryption|pseudoclient|protocol]"); } - 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 ¶m = !params.empty() ? params[0] : ""; @@ -189,7 +189,7 @@ class CommandOSModList : public Command source.Reply(_("%d modules loaded."), count); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_module.cpp b/modules/commands/os_module.cpp index f2bd636a4..d878cd1a1 100644 --- a/modules/commands/os_module.cpp +++ b/modules/commands/os_module.cpp @@ -20,7 +20,7 @@ class CommandOSModLoad : public Command this->SetSyntax(_("\037modname\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 &mname = params[0]; @@ -38,7 +38,7 @@ class CommandOSModLoad : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -57,7 +57,7 @@ class CommandOSModReLoad : public Command this->SetSyntax(_("\037modname\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 &mname = params[0]; @@ -111,7 +111,7 @@ class CommandOSModReLoad : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -129,7 +129,7 @@ class CommandOSModUnLoad : public Command this->SetSyntax(_("\037modname\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 &mname = params[0]; @@ -161,7 +161,7 @@ class CommandOSModUnLoad : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index f199cdad5..6f8adb078 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -61,7 +61,7 @@ struct NewsMessages msgarray[] = { struct MyNewsItem : NewsItem { - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["type"] << this->type; data["text"] << this->text; @@ -106,17 +106,17 @@ class MyNewsService : public NewsService delete newsItems[i][j]; } - NewsItem *CreateNewsItem() anope_override + NewsItem *CreateNewsItem() override { return new MyNewsItem(); } - void AddNewsItem(NewsItem *n) anope_override + void AddNewsItem(NewsItem *n) override { this->newsItems[n->type].push_back(n); } - void DelNewsItem(NewsItem *n) anope_override + void DelNewsItem(NewsItem *n) override { std::vector<NewsItem *> &list = this->GetNewsList(n->type); std::vector<NewsItem *>::iterator it = std::find(list.begin(), list.end(), n); @@ -125,7 +125,7 @@ class MyNewsService : public NewsService delete n; } - std::vector<NewsItem *> &GetNewsList(NewsType t) anope_override + std::vector<NewsItem *> &GetNewsList(NewsType t) override { return this->newsItems[t]; } @@ -297,12 +297,12 @@ class CommandOSLogonNews : public NewsBase this->SetDesc(_("Define messages to be shown to users at logon")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { return this->DoNews(source, params, NEWS_LOGON); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -324,12 +324,12 @@ class CommandOSOperNews : public NewsBase this->SetDesc(_("Define messages to be shown to users who oper")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { return this->DoNews(source, params, NEWS_OPER); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -351,12 +351,12 @@ class CommandOSRandomNews : public NewsBase this->SetDesc(_("Define messages to be randomly shown to users at logon")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { return this->DoNews(source, params, NEWS_RANDOM); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -438,20 +438,20 @@ class OSNews : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { oper_announcer = conf->GetModule(this)->Get<const Anope::string>("oper_announcer", "OperServ"); announcer = conf->GetModule(this)->Get<const Anope::string>("announcer", "Global"); news_count = conf->GetModule(this)->Get<unsigned>("newscount", "3"); } - void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) override { if (mname == "OPER") DisplayNews(u, NEWS_OPER); } - void OnUserConnect(User *user, bool &) anope_override + void OnUserConnect(User *user, bool &) override { if (user->Quitting() || !user->server->IsSynced()) return; diff --git a/modules/commands/os_noop.cpp b/modules/commands/os_noop.cpp index bff3fda8b..4a14a6528 100644 --- a/modules/commands/os_noop.cpp +++ b/modules/commands/os_noop.cpp @@ -21,7 +21,7 @@ class CommandOSNOOP : public Command this->SetSyntax(_("REVOKE \037server\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 &cmd = params[0]; const Anope::string &server = params[1]; @@ -61,7 +61,7 @@ class CommandOSNOOP : public Command 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(" "); @@ -85,7 +85,7 @@ class OSNOOP : public Module } - void OnUserModeSet(const MessageSource &, User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &, User *u, const Anope::string &mname) override { Anope::string *setter; if (mname == "OPER" && (setter = noop.Get(u->server))) diff --git a/modules/commands/os_oline.cpp b/modules/commands/os_oline.cpp deleted file mode 100644 index c40338b9f..000000000 --- a/modules/commands/os_oline.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* OperServ core functions - * - * (C) 2003-2021 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -#include "module.h" - -class CommandOSOLine : public Command -{ - public: - CommandOSOLine(Module *creator) : Command(creator, "operserv/oline", 2, 2) - { - this->SetDesc(_("Give Operflags to a certain user")); - this->SetSyntax(_("\037nick\037 \037flags\037")); - } - - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override - { - const Anope::string &nick = params[0]; - const Anope::string &flag = params[1]; - User *u2 = NULL; - - /* let's check whether the user is online */ - if (!(u2 = User::Find(nick, true))) - source.Reply(NICK_X_NOT_IN_USE, nick.c_str()); - else if (u2 && flag[0] == '+') - { - IRCD->SendSVSO(source.service, nick, flag); - u2->SetMode(source.service, "OPER"); - u2->SendMessage(source.service, _("You are now an IRC Operator.")); - source.Reply(_("Operflags \002%s\002 have been added for \002%s\002."), flag.c_str(), nick.c_str()); - Log(LOG_ADMIN, source, this) << "for " << nick; - } - else if (u2 && flag[0] == '-') - { - IRCD->SendSVSO(source.service, nick, flag); - source.Reply(_("Operflags \002%s\002 have been removed from \002%s\002."), flag.c_str(), nick.c_str()); - Log(LOG_ADMIN, source, this) << "for " << nick; - } - else - this->OnSyntaxError(source, ""); - - return; - } - - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override - { - this->SendSyntax(source); - source.Reply(" "); - source.Reply(_("Allows Services Operators to give Operflags to any user.\n" - "Flags have to be prefixed with a \"+\" or a \"-\". To\n" - "remove all flags simply type a \"-\" instead of any flags.")); - return true; - } -}; - -class OSOLine : public Module -{ - CommandOSOLine commandosoline; - - public: - OSOLine(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), - commandosoline(this) - { - - if (!IRCD || !IRCD->CanSVSO) - throw ModuleException("Your IRCd does not support OMODE."); - - } -}; - -MODULE_INIT(OSOLine) diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp index 386394d07..ee7c87028 100644 --- a/modules/commands/os_oper.cpp +++ b/modules/commands/os_oper.cpp @@ -15,7 +15,7 @@ struct MyOper : Oper, Serializable { MyOper(const Anope::string &n, OperType *o) : Oper(n, o), Serializable("Oper") { } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["name"] << this->name; data["type"] << this->ot->GetName(); @@ -73,7 +73,7 @@ class CommandOSOper : public Command this->SetSyntax("LIST"); } - 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 &subcommand = params[0]; @@ -243,7 +243,7 @@ class CommandOSOper : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -279,7 +279,7 @@ class OSOper : public Module } } - void OnDelCore(NickCore *nc) anope_override + void OnDelCore(NickCore *nc) override { if (nc->o && dynamic_cast<MyOper *>(nc->o)) { diff --git a/modules/commands/os_reload.cpp b/modules/commands/os_reload.cpp index 36a52f5f2..f3a801db8 100644 --- a/modules/commands/os_reload.cpp +++ b/modules/commands/os_reload.cpp @@ -19,7 +19,7 @@ class CommandOSReload : public Command this->SetDesc(_("Reload services' configuration file")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { try { @@ -40,7 +40,7 @@ class CommandOSReload : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index b6e4761f4..a667cac10 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -42,24 +42,24 @@ class MySessionService : public SessionService public: MySessionService(Module *m) : SessionService(m), Exceptions("Exception") { } - Exception *CreateException() anope_override + Exception *CreateException() override { return new Exception(); } - void AddException(Exception *e) anope_override + void AddException(Exception *e) override { this->Exceptions->push_back(e); } - void DelException(Exception *e) anope_override + void DelException(Exception *e) override { ExceptionVector::iterator it = std::find(this->Exceptions->begin(), this->Exceptions->end(), e); if (it != this->Exceptions->end()) this->Exceptions->erase(it); } - Exception *FindException(User *u) anope_override + Exception *FindException(User *u) override { for (std::vector<Exception *>::const_iterator it = this->Exceptions->begin(), it_end = this->Exceptions->end(); it != it_end; ++it) { @@ -73,7 +73,7 @@ class MySessionService : public SessionService return NULL; } - Exception *FindException(const Anope::string &host) anope_override + Exception *FindException(const Anope::string &host) override { for (std::vector<Exception *>::const_iterator it = this->Exceptions->begin(), it_end = this->Exceptions->end(); it != it_end; ++it) { @@ -88,7 +88,7 @@ class MySessionService : public SessionService return NULL; } - ExceptionVector &GetExceptions() anope_override + ExceptionVector &GetExceptions() override { return this->Exceptions; } @@ -98,7 +98,7 @@ class MySessionService : public SessionService this->Sessions.erase(s->addr); } - Session *FindSession(const Anope::string &ip) anope_override + Session *FindSession(const Anope::string &ip) override { cidr c(ip, ip.find(':') != Anope::string::npos ? ipv6_cidr : ipv4_cidr); if (!c.valid()) @@ -122,7 +122,7 @@ class MySessionService : public SessionService return this->Sessions[ip]; } - SessionMap &GetSessions() anope_override + SessionMap &GetSessions() override { return this->Sessions; } @@ -132,10 +132,10 @@ class ExceptionDelCallback : public NumberList { protected: CommandSource &source; - unsigned deleted; + unsigned deleted = 0; Command *cmd; public: - ExceptionDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), deleted(0), cmd(c) + ExceptionDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), cmd(c) { } @@ -149,7 +149,7 @@ class ExceptionDelCallback : public NumberList source.Reply(_("Deleted %d entries from session-limit exception list."), deleted); } - virtual void HandleNumber(unsigned number) anope_override + virtual void HandleNumber(unsigned number) override { if (!number || number > session_service->GetExceptions().size()) return; @@ -247,7 +247,7 @@ class CommandOSSession : public Command this->SetSyntax(_("VIEW \037host\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 &cmd = params[0]; @@ -263,7 +263,7 @@ class CommandOSSession : public Command 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(" "); @@ -445,7 +445,7 @@ class CommandOSException : public Command { } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > session_service->GetExceptions().size()) return; @@ -526,7 +526,7 @@ class CommandOSException : public Command this->SetSyntax(_("VIEW [\037mask\037 | \037list\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 &cmd = params[0]; @@ -544,7 +544,7 @@ class CommandOSException : public Command 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(" "); @@ -597,12 +597,12 @@ class OSSession : public Module this->SetPermanent(true); } - void Prioritize() anope_override + void Prioritize() override { ModuleManager::SetPriority(this, PRIORITY_FIRST); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = Config->GetModule(this); @@ -622,7 +622,7 @@ class OSSession : public Module throw ConfigException(this->name + ": session CIDR value out of range"); } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (u->Quitting() || !session_limit || exempt || !u->server || u->server->IsULined()) return; @@ -693,7 +693,7 @@ class OSSession : public Module } } - void OnUserQuit(User *u, const Anope::string &msg) anope_override + void OnUserQuit(User *u, const Anope::string &msg) override { if (!session_limit || !u->server || u->server->IsULined()) return; @@ -716,7 +716,7 @@ class OSSession : public Module sessions.erase(sit); } - void OnExpireTick() anope_override + void OnExpireTick() override { if (Anope::NoExpire) return; diff --git a/modules/commands/os_set.cpp b/modules/commands/os_set.cpp index 46051dcdc..b03bab01f 100644 --- a/modules/commands/os_set.cpp +++ b/modules/commands/os_set.cpp @@ -170,7 +170,7 @@ class CommandOSSet : public Command this->SetSyntax(_("\037option\037 \037setting\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 &option = params[0]; @@ -190,7 +190,7 @@ class CommandOSSet : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (subcommand.empty()) { diff --git a/modules/commands/os_shutdown.cpp b/modules/commands/os_shutdown.cpp index 57fc62a67..a6bb5252b 100644 --- a/modules/commands/os_shutdown.cpp +++ b/modules/commands/os_shutdown.cpp @@ -19,7 +19,7 @@ class CommandOSQuit : public Command this->SetDesc(_("Terminate Services WITHOUT saving")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Log(LOG_ADMIN, source, this); Anope::QuitReason = source.command + " command received from " + source.GetNick(); @@ -27,7 +27,7 @@ class CommandOSQuit : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -47,7 +47,7 @@ class CommandOSRestart : public Command this->SetDesc(_("Save databases and restart Services")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Log(LOG_ADMIN, source, this); Anope::QuitReason = source.command + " command received from " + source.GetNick(); @@ -56,7 +56,7 @@ class CommandOSRestart : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(_("Causes Services to save all databases and then restart\n" @@ -73,7 +73,7 @@ class CommandOSShutdown : public Command this->SetDesc(_("Terminate services with save")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Log(LOG_ADMIN, source, this); Anope::QuitReason = source.command + " command received from " + source.GetNick(); @@ -82,7 +82,7 @@ class CommandOSShutdown : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_stats.cpp b/modules/commands/os_stats.cpp index 7e53af8ca..42d727fa2 100644 --- a/modules/commands/os_stats.cpp +++ b/modules/commands/os_stats.cpp @@ -21,7 +21,7 @@ struct Stats : Serializable me = this; } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["maxusercnt"] << MaxUserCount; data["maxusertime"] << MaxUserTime; @@ -204,7 +204,7 @@ class CommandOSStats : public Command this->SetSyntax("[AKILL | HASH | UPLINK | UPTIME | ALL | RESET]"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string extra = !params.empty() ? params[0] : ""; @@ -229,7 +229,7 @@ class CommandOSStats : public Command source.Reply(_("Unknown STATS option: \002%s\002"), extra.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -266,7 +266,7 @@ class OSStats : public Module } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (UserListByNick.size() == MaxUserCount && Anope::CurTime == MaxUserTime) stats_saver.QueueUpdate(); diff --git a/modules/commands/os_svs.cpp b/modules/commands/os_svs.cpp index ae1431dbd..14d94d436 100644 --- a/modules/commands/os_svs.cpp +++ b/modules/commands/os_svs.cpp @@ -20,7 +20,7 @@ class CommandOSSVSNick : public Command this->SetSyntax(_("\037nick\037 \037newnick\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 &nick = params[0]; Anope::string newnick = params[1]; @@ -61,7 +61,7 @@ class CommandOSSVSNick : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -79,7 +79,7 @@ class CommandOSSVSJoin : public Command this->SetSyntax(_("\037nick\037 \037channel\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!IRCD->CanSVSJoin) { @@ -105,7 +105,7 @@ class CommandOSSVSJoin : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -123,7 +123,7 @@ class CommandOSSVSPart : public Command this->SetSyntax(_("\037nick\037 \037channel\037 [\037reason\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!IRCD->CanSVSJoin) { @@ -153,7 +153,7 @@ class CommandOSSVSPart : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 167115194..eedf1d02c 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -16,9 +16,9 @@ class SXLineDelCallback : public NumberList XLineManager *xlm; Command *command; CommandSource &source; - unsigned deleted; + unsigned deleted = 0; public: - SXLineDelCallback(XLineManager *x, Command *c, CommandSource &_source, const Anope::string &numlist) : NumberList(numlist, true), xlm(x), command(c), source(_source), deleted(0) + SXLineDelCallback(XLineManager *x, Command *c, CommandSource &_source, const Anope::string &numlist) : NumberList(numlist, true), xlm(x), command(c), source(_source) { } @@ -32,7 +32,7 @@ class SXLineDelCallback : public NumberList source.Reply(_("Deleted %d entries from the %s list."), deleted, source.command.c_str()); } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number) return; @@ -128,7 +128,7 @@ class CommandOSSXLineBase : public Command { } - void HandleNumber(unsigned number) anope_override + void HandleNumber(unsigned number) override { if (!number) return; @@ -228,12 +228,12 @@ class CommandOSSXLineBase : public Command { } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Manipulate the %s list")), source.command.upper().c_str()); } - 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 &cmd = params[0]; @@ -253,17 +253,17 @@ class CommandOSSXLineBase : public Command return; } - virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override = 0; + virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) override = 0; }; class CommandOSSNLine : public CommandOSSXLineBase { - XLineManager *xlm() anope_override + XLineManager *xlm() override { return this->snlines; } - void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!this->xlm()) return; @@ -429,7 +429,7 @@ class CommandOSSNLine : public CommandOSSXLineBase this->SetSyntax("CLEAR"); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -484,12 +484,12 @@ class CommandOSSNLine : public CommandOSSXLineBase class CommandOSSQLine : public CommandOSSXLineBase { - XLineManager *xlm() anope_override + XLineManager *xlm() override { return this->sqlines; } - void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void OnAdd(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (!this->xlm()) return; @@ -663,7 +663,7 @@ class CommandOSSQLine : public CommandOSSXLineBase this->SetSyntax("CLEAR"); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/os_update.cpp b/modules/commands/os_update.cpp index d81dbb12e..849485181 100644 --- a/modules/commands/os_update.cpp +++ b/modules/commands/os_update.cpp @@ -19,7 +19,7 @@ class CommandOSUpdate : public Command this->SetDesc(_("Force the Services databases to be updated immediately")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Log(LOG_ADMIN, source, this); source.Reply(_("Updating databases.")); @@ -27,7 +27,7 @@ class CommandOSUpdate : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); |