From a5f7aac2953e94e49b93e9195ae8d4dccba46f6d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 3 Jan 2022 16:50:06 +0000 Subject: Replace anope_{final,override} with their C++11 equivalent. --- modules/protocol/bahamut.cpp | 68 ++++++++-------- modules/protocol/hybrid.cpp | 90 +++++++++++----------- modules/protocol/inspircd.cpp | 166 ++++++++++++++++++++-------------------- modules/protocol/ngircd.cpp | 58 +++++++------- modules/protocol/plexus.cpp | 68 ++++++++-------- modules/protocol/ratbox.cpp | 54 ++++++------- modules/protocol/solanum.cpp | 84 ++++++++++---------- modules/protocol/unrealircd.cpp | 150 ++++++++++++++++++------------------ 8 files changed, 369 insertions(+), 369 deletions(-) (limited to 'modules/protocol') diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 904622bf4..7f86e9e0c 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -16,7 +16,7 @@ class ChannelModeFlood : public ChannelModeParam public: ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam("FLOOD", modeChar, minusNoArg) { } - bool IsValid(Anope::string &value) const anope_override + bool IsValid(Anope::string &value) const override { try { @@ -45,7 +45,7 @@ class BahamutIRCdProto : public IRCDProto MaxModes = 60; } - void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) override { if (Servers::Capab.count("TSMODE") > 0) { @@ -55,47 +55,47 @@ class BahamutIRCdProto : public IRCDProto IRCDProto::SendModeInternal(source, dest, buf); } - void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVSMODE " << u->nick << " " << u->timestamp << " " << buf; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg; } /* SVSHOLD - set */ - void SendSVSHold(const Anope::string &nick, time_t time) anope_override + void SendSVSHold(const Anope::string &nick, time_t time) override { UplinkSocket::Message(Me) << "SVSHOLD " << nick << " " << time << " :Being held for registered user"; } /* SVSHOLD - release */ - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { UplinkSocket::Message(Me) << "SVSHOLD " << nick << " 0"; } /* SQLINE */ - void SendSQLine(User *, const XLine *x) anope_override + void SendSQLine(User *, const XLine *x) override { UplinkSocket::Message() << "SQLINE " << x->mask << " :" << x->GetReason(); } /* UNSLINE */ - void SendSGLineDel(const XLine *x) anope_override + void SendSGLineDel(const XLine *x) override { UplinkSocket::Message() << "UNSGLINE 0 :" << x->mask; } /* UNSZLINE */ - void SendSZLineDel(const XLine *x) anope_override + void SendSZLineDel(const XLine *x) override { /* this will likely fail so its only here for legacy */ UplinkSocket::Message() << "UNSZLINE 0 " << x->GetHost(); @@ -104,7 +104,7 @@ class BahamutIRCdProto : public IRCDProto } /* SZLINE */ - void SendSZLine(User *, const XLine *x) anope_override + void SendSZLine(User *, const XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -117,19 +117,19 @@ class BahamutIRCdProto : public IRCDProto } /* SVSNOOP */ - void SendSVSNOOP(const Server *server, bool set) anope_override + void SendSVSNOOP(const Server *server, bool set) override { UplinkSocket::Message() << "SVSNOOP " << server->GetName() << " " << (set ? "+" : "-"); } /* SGLINE */ - void SendSGLine(User *, const XLine *x) anope_override + void SendSGLine(User *, const XLine *x) override { UplinkSocket::Message() << "SGLINE " << x->mask.length() << " :" << x->mask << ":" << x->GetReason(); } /* RAKILL */ - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) return; @@ -149,19 +149,19 @@ class BahamutIRCdProto : public IRCDProto } /* TOPIC */ - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { UplinkSocket::Message(source) << "TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_ts << " :" << c->topic; } /* UNSQLINE */ - void SendSQLineDel(const XLine *x) anope_override + void SendSQLineDel(const XLine *x) override { UplinkSocket::Message() << "UNSQLINE " << x->mask; } /* JOIN - SJOIN */ - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(user) << "SJOIN " << c->creation_time << " " << c->name; if (status) @@ -184,7 +184,7 @@ class BahamutIRCdProto : public IRCDProto } } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) { @@ -230,34 +230,34 @@ class BahamutIRCdProto : public IRCDProto /* Note: if the stamp is null 0, the below usage is correct of Bahamut */ - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVSKILL " << user->nick << " :" << buf; } - void SendBOB() anope_override + void SendBOB() override { UplinkSocket::Message() << "BURST"; } - void SendEOB() anope_override + void SendEOB() override { UplinkSocket::Message() << "BURST 0"; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message() << "NICK " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " " << u->server->GetName() << " 0 0 :" << u->realname; } /* SERVER */ - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription(); } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " :TS"; UplinkSocket::Message() << "CAPAB SSJOIN NOQUIT BURST UNCONNECT NICKIP TSMODE TS3"; @@ -274,7 +274,7 @@ class BahamutIRCdProto : public IRCDProto this->SendBOB(); } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { Anope::string modes = c->GetModes(true, true); if (modes.empty()) @@ -282,12 +282,12 @@ class BahamutIRCdProto : public IRCDProto UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :"; } - void SendLogin(User *u, NickAlias *) anope_override + void SendLogin(User *u, NickAlias *) override { IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %d", u->signon); } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { IRCD->SendMode(Config->GetClient("NickServ"), u, "+d 1"); } @@ -297,7 +297,7 @@ struct IRCDMessageBurst : IRCDMessage { IRCDMessageBurst(Module *creator) : IRCDMessage(creator, "BURST", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { /* If we found a server with the given source, that one just * finished bursting. If there was no source, then our uplink @@ -315,7 +315,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator, const Anope::string &sname) : IRCDMessage(creator, sname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (params.size() > 2 && IRCD->IsChannelValid(params[0])) { @@ -366,7 +366,7 @@ struct IRCDMessageNick : IRCDMessage { IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (params.size() == 10) { @@ -399,7 +399,7 @@ struct IRCDMessageServer : IRCDMessage { IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo(params[1]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[2]); @@ -410,7 +410,7 @@ struct IRCDMessageSJoin : IRCDMessage { IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { Anope::string modes; if (params.size() >= 4) @@ -466,7 +466,7 @@ struct IRCDMessageTopic : IRCDMessage { IRCDMessageTopic(Module *creator) : IRCDMessage(creator, "TOPIC", 4) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { Channel *c = Channel::Find(params[0]); if (c) @@ -559,7 +559,7 @@ class ProtoBahamut : public Module } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED")); IRCD->SendLogout(u); diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 39914142d..8d9267438 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -16,7 +16,7 @@ static bool UseSVSAccount = false; // Temporary backwards compatibility hack un class HybridProto : public IRCDProto { - void SendSVSKillInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *u, const Anope::string &buf) override { IRCDProto::SendSVSKillInternal(source, u, buf); u->KillInternal(source, buf); @@ -39,42 +39,42 @@ class HybridProto : public IRCDProto MaxModes = 6; } - void SendInvite(const MessageSource &source, const Channel *c, User *u) anope_override + void SendInvite(const MessageSource &source, const Channel *c, User *u) override { UplinkSocket::Message(source) << "INVITE " << u->GetUID() << " " << c->name << " " << c->creation_time; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $$" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $$" << dest->GetName() << " :" << msg; } - void SendSQLine(User *, const XLine *x) anope_override + void SendSQLine(User *, const XLine *x) override { UplinkSocket::Message(Me) << "RESV * " << (x->expires ? x->expires - Anope::CurTime : 0) << " " << x->mask << " :" << x->reason; } - void SendSGLineDel(const XLine *x) anope_override + void SendSGLineDel(const XLine *x) override { UplinkSocket::Message(Me) << "UNXLINE * " << x->mask; } - void SendSGLine(User *, const XLine *x) anope_override + void SendSGLine(User *, const XLine *x) override { UplinkSocket::Message(Me) << "XLINE * " << x->mask << " " << (x->expires ? x->expires - Anope::CurTime : 0) << " :" << x->GetReason(); } - void SendSZLineDel(const XLine *x) anope_override + void SendSZLineDel(const XLine *x) override { UplinkSocket::Message(Me) << "UNDLINE * " << x->GetHost(); } - void SendSZLine(User *, const XLine *x) anope_override + void SendSZLine(User *, const XLine *x) override { /* Calculate the time left before this would expire, capping it at 2 days */ time_t timeleft = x->expires - Anope::CurTime; @@ -85,7 +85,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "DLINE * " << timeleft << " " << x->GetHost() << " :" << x->GetReason(); } - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) return; @@ -93,12 +93,12 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "UNKLINE * " << x->GetUser() << " " << x->GetHost(); } - void SendSQLineDel(const XLine *x) anope_override + void SendSQLineDel(const XLine *x) override { UplinkSocket::Message(Me) << "UNRESV * " << x->mask; } - void SendJoin(User *u, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *u, Channel *c, const ChannelStatus *status) override { /* * Note that we must send our modes with the SJOIN and can not add them to the @@ -117,7 +117,7 @@ class HybridProto : public IRCDProto } } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { if (x->IsRegex() || x->HasNickOrReal()) { @@ -158,7 +158,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "KLINE * " << timeleft << " " << x->GetUser() << " " << x->GetHost() << " :" << x->GetReason(); } - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { if (server == Me) UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() + 1 << " " << server->GetSID() << " +" << " :" << server->GetDescription(); @@ -166,7 +166,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SID " << server->GetName() << " " << server->GetHops() + 1 << " " << server->GetSID() << " +" << " :" << server->GetDescription(); } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password; @@ -186,7 +186,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SVINFO 6 6 0 :" << Anope::CurTime; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); @@ -194,17 +194,17 @@ class HybridProto : public IRCDProto << u->host << " " << u->host << " 0.0.0.0 " << u->GetUID() << " * :" << u->realname; } - void SendEOB() anope_override + void SendEOB() override { UplinkSocket::Message(Me) << "EOB"; } - void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) override { UplinkSocket::Message(source) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { if (UseSVSAccount == false) IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str()); @@ -212,7 +212,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SVSACCOUNT " << u->GetUID() << " " << u->timestamp << " " << na->nc->display; } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { if (UseSVSAccount == false) IRCD->SendMode(Config->GetClient("NickServ"), u, "+d *"); @@ -220,7 +220,7 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SVSACCOUNT " << u->GetUID() << " " << u->timestamp << " *"; } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { Anope::string modes = c->GetModes(true, true); @@ -230,22 +230,22 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Me) << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :"; } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { UplinkSocket::Message(source) << "TBURST " << c->creation_time << " " << c->name << " " << c->topic_ts << " " << c->topic_setter << " :" << c->topic; } - void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override + void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override { UplinkSocket::Message(Me) << "SVSNICK " << u->GetUID() << " " << u->timestamp << " " << newnick << " " << when; } - void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) anope_override + void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) override { UplinkSocket::Message(source) << "SVSJOIN " << u->GetUID() << " " << chan; } - void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) anope_override + void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override { if (!param.empty()) UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan << " :" << param; @@ -253,29 +253,29 @@ class HybridProto : public IRCDProto UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan; } - void SendSVSHold(const Anope::string &nick, time_t t) anope_override + void SendSVSHold(const Anope::string &nick, time_t t) override { XLine x(nick, Me->GetName(), Anope::CurTime + t, "Being held for registered user"); this->SendSQLine(NULL, &x); } - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { XLine x(nick); this->SendSQLineDel(&x); } - void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override + void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) override { UplinkSocket::Message(Me) << "SVSHOST " << u->GetUID() << " " << u->timestamp << " " << host; } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { UplinkSocket::Message(Me) << "SVSHOST " << u->GetUID() << " " << u->timestamp << " " << u->host; } - bool IsIdentValid(const Anope::string &ident) anope_override + bool IsIdentValid(const Anope::string &ident) override { if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get("userlen")) return false; @@ -305,7 +305,7 @@ struct IRCDMessageBMask : IRCDMessage /* 0 1 2 3 */ /* :0MC BMASK 1350157102 #channel b :*!*@*.test.com */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { Channel *c = Channel::Find(params[1]); ChannelMode *mode = ModeManager::FindChannelModeByChar(params[2][0]); @@ -325,7 +325,7 @@ struct IRCDMessageEOB : IRCDMessage { IRCDMessageEOB(Module *creator) : IRCDMessage(creator, "EOB", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { source.GetServer()->Sync(true); } @@ -335,7 +335,7 @@ struct IRCDMessageJoin : Message::Join { IRCDMessageJoin(Module *creator) : Message::Join(creator, "JOIN") { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (params.size() < 2) return; @@ -353,7 +353,7 @@ struct IRCDMessageNick : IRCDMessage /* 0 1 */ /* :0MCAAAAAB NICK newnick 1350157102 */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { source.GetUser()->ChangeNick(params[0], convertTo(params[1])); } @@ -365,7 +365,7 @@ struct IRCDMessagePass : IRCDMessage /* 0 */ /* PASS password */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (params.size() == 4) UplinkSID = params[3]; @@ -376,7 +376,7 @@ struct IRCDMessagePong : IRCDMessage { IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { source.GetServer()->Sync(false); } @@ -388,7 +388,7 @@ struct IRCDMessageServer : IRCDMessage /* 0 1 2 3 4 */ /* SERVER hades.arpa 1 4XY + :ircd-hybrid test server */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { /* Servers other than our immediate uplink are introduced via SID */ if (params[1] != "1") @@ -412,7 +412,7 @@ struct IRCDMessageSID : IRCDMessage /* 0 1 2 3 4 */ /* :0MC SID hades.arpa 2 4XY + :ircd-hybrid test server */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { unsigned int hops = params[1].is_pos_number_only() ? convertTo(params[1]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params.back(), params[2]); @@ -425,7 +425,7 @@ struct IRCDMessageSJoin : IRCDMessage { IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { Anope::string modes; @@ -476,7 +476,7 @@ struct IRCDMessageSVSMode : IRCDMessage * parv[1] = TS * parv[2] = mode */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { User *u = User::Find(params[0]); @@ -494,7 +494,7 @@ struct IRCDMessageTBurst : IRCDMessage { IRCDMessageTBurst(Module *creator) : IRCDMessage(creator, "TBURST", 5) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { Anope::string setter; sepstream(params[3], '!').GetToken(setter, 0); @@ -510,7 +510,7 @@ struct IRCDMessageTMode : IRCDMessage { IRCDMessageTMode(Module *creator) : IRCDMessage(creator, "TMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { time_t ts = 0; @@ -535,7 +535,7 @@ struct IRCDMessageUID : IRCDMessage { IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 10) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { NickAlias *na = NULL; @@ -557,7 +557,7 @@ struct IRCDMessageCertFP: IRCDMessage /* 0 */ /* :0MCAAAAAB CERTFP 4C62287BA6776A89CD4F8FF10A62FFB35E79319F51AF6C62C674984974FCCB1D */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { User *u = source.GetUser(); @@ -677,7 +677,7 @@ public: this->AddModes(); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED")); } diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index 054d8a58e..753cb7cd4 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -90,7 +90,7 @@ class InspIRCdProto : public IRCDProto return IRCDProto::GetMaxListFor(c, cm); } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "CAPAB START 1205"; UplinkSocket::Message() << "CAPAB CAPABILITIES :CASEMAPPING=" << Config->GetBlock("options")->Get("casemap", "ascii"); @@ -98,7 +98,7 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message() << "SERVER " << Me->GetName() << " " << Config->Uplinks[Anope::CurrentUplink].password << " 0 " << Me->GetSID() << " :" << Me->GetDescription(); } - void SendSASLMechanisms(std::vector &mechanisms) anope_override + void SendSASLMechanisms(std::vector &mechanisms) override { Anope::string mechlist; for (unsigned i = 0; i < mechanisms.size(); ++i) @@ -107,23 +107,23 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "METADATA * saslmechlist :" << (mechanisms.empty() ? "" : mechlist.substr(1)); } - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { IRCDProto::SendSVSKillInternal(source, user, buf); user->KillInternal(source, buf); } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg; } - void SendPong(const Anope::string &servname, const Anope::string &who) anope_override + void SendPong(const Anope::string &servname, const Anope::string &who) override { Server *serv = servname.empty() ? NULL : Server::Find(servname); if (!serv) @@ -132,7 +132,7 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message(serv) << "PONG " << who; } - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { { /* InspIRCd may support regex bans @@ -171,12 +171,12 @@ class InspIRCdProto : public IRCDProto } } - void SendInvite(const MessageSource &source, const Channel *c, User *u) anope_override + void SendInvite(const MessageSource &source, const Channel *c, User *u) override { UplinkSocket::Message(source) << "INVITE " << u->GetUID() << " " << c->name << " " << c->creation_time; } - void SendTopic(const MessageSource &source, Channel *c) anope_override + void SendTopic(const MessageSource &source, Channel *c) override { if (Servers::Capab.count("SVSTOPIC")) { @@ -193,7 +193,7 @@ class InspIRCdProto : public IRCDProto } } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { UserMode *um = ModeManager::FindUserModeByName("CLOAK"); @@ -205,7 +205,7 @@ class InspIRCdProto : public IRCDProto this->SendChgHostInternal(u->nick, u->chost); } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -267,17 +267,17 @@ class InspIRCdProto : public IRCDProto SendAddLine("G", x->GetUser() + "@" + x->GetHost(), timeleft, x->by, x->GetReason()); } - void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf) anope_override + void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf) override { UplinkSocket::Message() << "NUM " << Me->GetSID() << " " << dest << " " << numeric << " " << buf; } - void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override + void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) override { UplinkSocket::Message(source) << "FMODE " << dest->name << " " << dest->creation_time << " " << buf; } - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message(Me) << "UID " << u->GetUID() << " " << u->timestamp << " " << u->nick << " " << u->host << " " << u->host << " " << u->GetIdent() << " 0.0.0.0 " << u->timestamp << " " << modes << " :" << u->realname; @@ -285,14 +285,14 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message(u) << "OPERTYPE :service"; } - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { /* if rsquit is set then we are waiting on a squit */ if (rsquit_id.empty() && rsquit_server.empty()) UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetSID() << " :" << server->GetDescription(); } - void SendSquit(Server *s, const Anope::string &message) anope_override + void SendSquit(Server *s, const Anope::string &message) override { if (s != Me) { @@ -304,7 +304,7 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message() << "SQUIT " << s->GetName() << " :" << message; } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(Me) << "FJOIN " << c->name << " " << c->creation_time << " +" << c->GetModes(true, true) << " :," << user->GetUID(); /* Note that we can send this with the FJOIN but choose not to @@ -331,7 +331,7 @@ class InspIRCdProto : public IRCDProto } } - void SendSQLineDel(const XLine *x) anope_override + void SendSQLineDel(const XLine *x) override { if (IRCD->CanSQLineChannel && (x->mask[0] == '#')) SendDelLine("CBAN", x->mask); @@ -339,7 +339,7 @@ class InspIRCdProto : public IRCDProto SendDelLine("Q", x->mask); } - void SendSQLine(User *u, const XLine *x) anope_override + void SendSQLine(User *u, const XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -352,7 +352,7 @@ class InspIRCdProto : public IRCDProto SendAddLine("Q", x->mask, timeleft, x->by, x->GetReason()); } - void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override + void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) override { if (!vIdent.empty()) this->SendChgIdentInternal(u->nick, vIdent); @@ -360,22 +360,22 @@ class InspIRCdProto : public IRCDProto this->SendChgHostInternal(u->nick, vhost); } - void SendSVSHold(const Anope::string &nick, time_t t) anope_override + void SendSVSHold(const Anope::string &nick, time_t t) override { UplinkSocket::Message(Config->GetClient("NickServ")) << "SVSHOLD " << nick << " " << t << " :Being held for registered user"; } - void SendSVSHoldDel(const Anope::string &nick) anope_override + void SendSVSHoldDel(const Anope::string &nick) override { UplinkSocket::Message(Config->GetClient("NickServ")) << "SVSHOLD " << nick; } - void SendSZLineDel(const XLine *x) anope_override + void SendSZLineDel(const XLine *x) override { SendDelLine("Z", x->GetHost()); } - void SendSZLine(User *u, const XLine *x) anope_override + void SendSZLine(User *u, const XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -384,12 +384,12 @@ class InspIRCdProto : public IRCDProto SendAddLine("Z", x->GetHost(), timeleft, x->by, x->GetReason()); } - void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &other) anope_override + void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &other) override { UplinkSocket::Message(source) << "SVSJOIN " << u->GetUID() << " " << chan; } - void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) anope_override + void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override { if (!param.empty()) UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan << " :" << param; @@ -397,14 +397,14 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan; } - void SendSWhois(const MessageSource &bi, const Anope::string &who, const Anope::string &mask) anope_override + void SendSWhois(const MessageSource &bi, const Anope::string &who, const Anope::string &mask) override { User *u = User::Find(who); UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " swhois :" << mask; } - void SendBOB() anope_override + void SendBOB() override { UplinkSocket::Message(Me) << "BURST " << Anope::CurTime; Module *enc = ModuleManager::FindFirstOf(ENCRYPTION); @@ -413,12 +413,12 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "SINFO rawversion :Anope-" << Anope::VersionShort(); } - void SendEOB() anope_override + void SendEOB() override { UplinkSocket::Message(Me) << "ENDBURST"; } - void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override + void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) override { if (Servers::Capab.count("GLOBOPS")) UplinkSocket::Message(source) << "SNONOTICE g :" << buf; @@ -426,7 +426,7 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message(source) << "SNONOTICE A :" << buf; } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { /* InspIRCd uses an account to bypass chmode +R, not umode +r, so we can't send this here */ if (na->nc->HasExt("UNCONFIRMED")) @@ -436,23 +436,23 @@ class InspIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :" << na->nc->display; } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountid :"; UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :"; } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { UplinkSocket::Message(Me) << "FJOIN " << c->name << " " << c->creation_time << " +" << c->GetModes(true, true) << " :"; } - void SendSASLMessage(const SASL::Message &message) anope_override + void SendSASLMessage(const SASL::Message &message) override { UplinkSocket::Message(Me) << "ENCAP " << message.target.substr(0, 3) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext)); } - void SendSVSLogin(const Anope::string &uid, NickAlias *na) anope_override + void SendSVSLogin(const Anope::string &uid, NickAlias *na) override { UplinkSocket::Message(Me) << "METADATA " << uid << " accountid :" << na->nc->GetId(); UplinkSocket::Message(Me) << "METADATA " << uid << " accountname :" << na->nc->display; @@ -480,12 +480,12 @@ class InspIRCdProto : public IRCDProto saslusers.push_back(su); } - bool IsExtbanValid(const Anope::string &mask) anope_override + bool IsExtbanValid(const Anope::string &mask) override { return mask.length() >= 3 && mask[1] == ':'; } - bool IsIdentValid(const Anope::string &ident) anope_override + bool IsIdentValid(const Anope::string &ident) override { if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get("userlen")) return false; @@ -514,7 +514,7 @@ class InspIRCdAutoOpMode : public ChannelModeList { } - bool IsValid(Anope::string &mask) const anope_override + bool IsValid(Anope::string &mask) const override { // We can not validate this because we don't know about the // privileges of the setter so just reject attempts to set it. @@ -532,13 +532,13 @@ class InspIRCdExtBan : public ChannelModeVirtual { } - ChannelMode *Wrap(Anope::string ¶m) anope_override + ChannelMode *Wrap(Anope::string ¶m) override { param = Anope::string(ext) + ":" + param; return ChannelModeVirtual::Wrap(param); } - ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) anope_override + ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) override { if (cm->type != MODE_LIST || param.length() < 3 || param[0] != ext || param[1] != ':') return cm; @@ -557,7 +557,7 @@ namespace InspIRCdExtban { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); Anope::string real_mask = mask.substr(3); @@ -573,7 +573,7 @@ namespace InspIRCdExtban { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); @@ -609,7 +609,7 @@ namespace InspIRCdExtban { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); Anope::string real_mask = mask.substr(2); @@ -625,7 +625,7 @@ namespace InspIRCdExtban { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); Anope::string real_mask = mask.substr(2); @@ -640,7 +640,7 @@ namespace InspIRCdExtban { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); Anope::string real_mask = mask.substr(2); @@ -655,7 +655,7 @@ namespace InspIRCdExtban { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); Anope::string real_mask = mask.substr(2); @@ -670,7 +670,7 @@ namespace InspIRCdExtban { } - bool Matches(User *u, const Entry *e) anope_override + bool Matches(User *u, const Entry *e) override { const Anope::string &mask = e->GetMask(); Anope::string real_mask = mask.substr(2); @@ -684,7 +684,7 @@ class ColonDelimitedParamMode : public ChannelModeParam public: ColonDelimitedParamMode(const Anope::string &modename, char modeChar) : ChannelModeParam(modename, modeChar, true) { } - bool IsValid(Anope::string &value) const anope_override + bool IsValid(Anope::string &value) const override { return IsValid(value, false); } @@ -733,7 +733,7 @@ class SimpleNumberParamMode : public ChannelModeParam public: SimpleNumberParamMode(const Anope::string &modename, char modeChar) : ChannelModeParam(modename, modeChar, true) { } - bool IsValid(Anope::string &value) const anope_override + bool IsValid(Anope::string &value) const override { if (value.empty()) return false; // empty param is never valid @@ -758,7 +758,7 @@ class ChannelModeFlood : public ColonDelimitedParamMode public: ChannelModeFlood(char modeChar) : ColonDelimitedParamMode("FLOOD", modeChar) { } - bool IsValid(Anope::string &value) const anope_override + bool IsValid(Anope::string &value) const override { // The parameter of this mode is a bit different, it may begin with a '*', // ignore it if that's the case @@ -772,7 +772,7 @@ class ChannelModeHistory : public ColonDelimitedParamMode public: ChannelModeHistory(char modeChar) : ColonDelimitedParamMode("HISTORY", modeChar) { } - bool IsValid(Anope::string &value) const anope_override + bool IsValid(Anope::string &value) const override { return (ColonDelimitedParamMode::IsValid(value, true)); } @@ -783,7 +783,7 @@ class ChannelModeRedirect : public ChannelModeParam public: ChannelModeRedirect(char modeChar) : ChannelModeParam("REDIRECT", modeChar, true) { } - bool IsValid(Anope::string &value) const anope_override + bool IsValid(Anope::string &value) const override { // The parameter of this mode is a channel, and channel names start with '#' return ((!value.empty()) && (value[0] == '#')); @@ -794,7 +794,7 @@ struct IRCDMessageAway : Message::Away { IRCDMessageAway(Module *creator) : Message::Away(creator, "AWAY") { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { std::vector newparams(params); if (newparams.size() > 1) @@ -872,7 +872,7 @@ struct IRCDMessageCapab : Message::Capab IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (params[0].equals_cs("START")) { @@ -1208,7 +1208,7 @@ struct IRCDMessageEncap : IRCDMessage { IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 4) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (!Anope::Match(Me->GetSID(), params[0]) && !Anope::Match(Me->GetName(), params[0])) return; @@ -1258,7 +1258,7 @@ struct IRCDMessageFHost : IRCDMessage { IRCDMessageFHost(Module *creator) : IRCDMessage(creator, "FHOST", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { User *u = source.GetUser(); if (u->HasMode("CLOAK")) @@ -1271,7 +1271,7 @@ struct IRCDMessageFIdent : IRCDMessage { IRCDMessageFIdent(Module *creator) : IRCDMessage(creator, "FIDENT", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { source.GetUser()->SetIdent(params[0]); } @@ -1281,7 +1281,7 @@ struct IRCDMessageKick : IRCDMessage { IRCDMessageKick(Module *creator) : IRCDMessage(creator, "KICK", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { // Received: :715AAAAAA KICK #chan 715AAAAAD :reason // Received: :715AAAAAA KICK #chan 628AAAAAA 4 :reason @@ -1300,7 +1300,7 @@ struct IRCDMessageSave : IRCDMessage IRCDMessageSave(Module *creator) : IRCDMessage(creator, "SAVE", 2), last_collide(0) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { User *targ = User::Find(params[0]); time_t ts; @@ -1345,7 +1345,7 @@ class IRCDMessageMetadata : IRCDMessage public: IRCDMessageMetadata(Module *creator, const bool &handle_topiclock, const bool &handle_mlock, PrimitiveExtensibleItem &listlimits) : IRCDMessage(creator, "METADATA", 3), do_topiclock(handle_topiclock), do_mlock(handle_mlock), maxlist(listlimits) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { // We deliberately ignore non-bursting servers to avoid pseudoserver fights // Channel METADATA has an additional parameter: the channel TS @@ -1476,7 +1476,7 @@ struct IRCDMessageEndburst : IRCDMessage { IRCDMessageEndburst(Module *creator) : IRCDMessage(creator, "ENDBURST", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { Server *s = source.GetServer(); @@ -1490,7 +1490,7 @@ struct IRCDMessageFJoin : IRCDMessage { IRCDMessageFJoin(Module *creator) : IRCDMessage(creator, "FJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { Anope::string modes; if (params.size() >= 3) @@ -1546,7 +1546,7 @@ struct IRCDMessageFMode : IRCDMessage { IRCDMessageFMode(Module *creator) : IRCDMessage(creator, "FMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { /* :source FMODE #test 12345678 +nto foo */ @@ -1575,7 +1575,7 @@ struct IRCDMessageFTopic : IRCDMessage { IRCDMessageFTopic(Module *creator) : IRCDMessage(creator, "FTOPIC", 4) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { // :source FTOPIC channel ts topicts :topic // :source FTOPIC channel ts topicts setby :topic (burst or RESYNC) @@ -1593,7 +1593,7 @@ struct IRCDMessageIdle : IRCDMessage { IRCDMessageIdle(Module *creator) : IRCDMessage(creator, "IDLE", 1) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { BotInfo *bi = BotInfo::Find(params[0]); if (bi) @@ -1611,7 +1611,7 @@ struct IRCDMessageIJoin : IRCDMessage { IRCDMessageIJoin(Module *creator) : IRCDMessage(creator, "IJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { // : IJOIN [ []] Channel *c = Channel::Find(params[0]); @@ -1647,7 +1647,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator) : IRCDMessage(creator, "MODE", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (IRCD->IsChannelValid(params[0])) { @@ -1677,7 +1677,7 @@ struct IRCDMessageNick : IRCDMessage { IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { source.GetUser()->ChangeNick(params[0]); } @@ -1687,7 +1687,7 @@ struct IRCDMessageOperType : IRCDMessage { IRCDMessageOperType(Module *creator) : IRCDMessage(creator, "OPERTYPE", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { /* opertype is equivalent to mode +o because servers don't do this directly */ @@ -1701,7 +1701,7 @@ struct IRCDMessagePing : IRCDMessage { IRCDMessagePing(Module *creator) : IRCDMessage(creator, "PING", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (params[0] == Me->GetSID()) IRCD->SendPong(params[0], source.GetServer()->GetSID()); @@ -1712,7 +1712,7 @@ struct IRCDMessageRSQuit : IRCDMessage { IRCDMessageRSQuit(Module *creator) : IRCDMessage(creator, "RSQUIT", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { Server *s = Server::Find(params[0]); const Anope::string &reason = params.size() > 1 ? params[1] : ""; @@ -1728,7 +1728,7 @@ struct IRCDMessageServer : IRCDMessage { IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (!source.GetServer() && params.size() == 5) { @@ -1761,7 +1761,7 @@ struct IRCDMessageSQuit : Message::SQuit { IRCDMessageSQuit(Module *creator) : Message::SQuit(creator) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { if (params[0] == rsquit_id || params[0] == rsquit_server) { @@ -1783,7 +1783,7 @@ struct IRCDMessageTime : IRCDMessage { IRCDMessageTime(Module *creator) : IRCDMessage(creator, "TIME", 2) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { UplinkSocket::Message(Me) << "TIME " << source.GetSource() << " " << params[1] << " " << Anope::CurTime; } @@ -1806,7 +1806,7 @@ struct IRCDMessageUID : IRCDMessage * 8+: modes and params -- IMPORTANT, some modes (e.g. +s) may have parameters. So don't assume a fixed position of realname! * last: realname */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { time_t ts = convertTo(params[1]); @@ -1898,24 +1898,24 @@ class ProtoInspIRCd : public Module { } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { use_server_side_topiclock = conf->GetModule(this)->Get("use_server_side_topiclock"); use_server_side_mlock = conf->GetModule(this)->Get("use_server_side_mlock"); } - void OnUserNickChange(User *u, const Anope::string &) anope_override + void OnUserNickChange(User *u, const Anope::string &) override { u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED")); } - void OnChannelSync(Channel *c) anope_override + void OnChannelSync(Channel *c) override { if (c->ci) this->OnChanRegistered(c->ci); } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { ModeLocks *modelocks = ci->GetExt("modelocks"); if (use_server_side_mlock && ci->c && modelocks && !modelocks->GetMLockAsString(false).empty()) @@ -1931,7 +1931,7 @@ class ProtoInspIRCd : public Module } } - void OnDelChan(ChannelInfo *ci) anope_override + void OnDelChan(ChannelInfo *ci) override { if (use_server_side_mlock && ci->c) SendChannelMetadata(ci->c, "mlock", ""); @@ -1940,7 +1940,7 @@ class ProtoInspIRCd : public Module SendChannelMetadata(ci->c, "topiclock", ""); } - EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); @@ -1953,7 +1953,7 @@ class ProtoInspIRCd : public Module return EVENT_CONTINUE; } - EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) anope_override + EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) override { ModeLocks *modelocks = ci->GetExt("modelocks"); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name); @@ -1966,7 +1966,7 @@ class ProtoInspIRCd : public Module return EVENT_CONTINUE; } - EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) anope_override + EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) override { if (cmd->name == "chanserv/topic" && ci->c) { diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index f0a287abb..5b41b3d7f 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -13,7 +13,7 @@ class ngIRCdProto : public IRCDProto { - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) override { IRCDProto::SendSVSKillInternal(source, user, buf); user->KillInternal(source, buf); @@ -30,7 +30,7 @@ class ngIRCdProto : public IRCDProto MaxModes = 5; } - void SendAkill(User *u, XLine *x) anope_override + void SendAkill(User *u, XLine *x) override { // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = x->expires - Anope::CurTime; @@ -39,24 +39,24 @@ class ngIRCdProto : public IRCDProto UplinkSocket::Message(Me) << "GLINE " << x->mask << " " << timeleft << " :" << x->GetReason() << " (" << x->by << ")"; } - void SendAkillDel(const XLine *x) anope_override + void SendAkillDel(const XLine *x) override { UplinkSocket::Message(Me) << "GLINE " << x->mask; } - void SendChannel(Channel *c) anope_override + void SendChannel(Channel *c) override { UplinkSocket::Message(Me) << "CHANINFO " << c->name << " +" << c->GetModes(true, true); } // Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator - void SendClientIntroduction(User *u) anope_override + void SendClientIntroduction(User *u) override { Anope::string modes = "+" + u->GetModes(); UplinkSocket::Message(Me) << "NICK " << u->nick << " 1 " << u->GetIdent() << " " << u->host << " 1 " << modes << " :" << u->realname; } - void SendConnect() anope_override + void SendConnect() override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " 0210-IRC+ Anope|" << Anope::VersionShort() << ":CLHMSo P"; /* Make myself known to myself in the serverlist */ @@ -65,27 +65,27 @@ class ngIRCdProto : public IRCDProto this->SendNumeric(376, "*", ":End of MOTD command"); } - void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override + void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override { UplinkSocket::Message(Me) << "SVSNICK " << u->nick << " " << newnick; } - void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg; } - void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override + void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) override { UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg; } - void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override + void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) override { UplinkSocket::Message(source) << "WALLOPS :" << buf; } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(user) << "JOIN " << c->name; if (status) @@ -108,23 +108,23 @@ class ngIRCdProto : public IRCDProto } } - void SendLogin(User *u, NickAlias *na) anope_override + void SendLogin(User *u, NickAlias *na) override { UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :" << na->nc->display; } - void SendLogout(User *u) anope_override + void SendLogout(User *u) override { UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :"; } /* SERVER name hop descript */ - void SendServer(const Server *server) anope_override + void SendServer(const Server *server) override { UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription(); } - void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override + void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) override { if (!vIdent.empty()) UplinkSocket::Message(Me) << "METADATA " << u->nick << " user :" << vIdent; @@ -137,12 +137,12 @@ class ngIRCdProto : public IRCDProto } } - void SendVhostDel(User *u) anope_override + void SendVhostDel(User *u) override { this->SendVhost(u, u->GetIdent(), ""); } - Anope::string Format(const Anope::string &source, const Anope::string &message) anope_override + Anope::string Format(const Anope::string &source, const Anope::string &message) override { return IRCDProto::Format(source.empty() ? Me->GetSID() : source, message); } @@ -153,7 +153,7 @@ struct IRCDMessage005 : IRCDMessage IRCDMessage005(Module *creator) : IRCDMessage(creator, "005", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } // Please see for details. - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { size_t pos; Anope::string parameter, data; @@ -194,7 +194,7 @@ struct IRCDMessage376 : IRCDMessage * */ - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override { } }; @@ -220,7 +220,7 @@ struct IRCDMessageChaninfo : IRCDMessage * a channel has no user limit (the parameter doesn't list the "l" * channel mode). In this case should be "0". */ - void Run(MessageSource &source, const std::vector