modules: use override keyword

Resolves #736
This commit is contained in:
J-P Nurmi
2014-11-05 07:48:24 +01:00
parent f7270e8b2e
commit f9318d02cf
57 changed files with 509 additions and 509 deletions

View File

@@ -32,7 +32,7 @@ public:
}
}
virtual void runThread() {
virtual void runThread() override {
// Cannot safely use GetModule() in here, because this runs in its
// own thread and such an access would require synchronisation
// between this thread and the main thread!
@@ -45,7 +45,7 @@ public:
}
}
virtual void runMain() {
virtual void runMain() override {
GetModule()->PutModule("Sample job done");
}
};
@@ -58,7 +58,7 @@ public:
private:
protected:
virtual void RunJob() {
virtual void RunJob() override {
GetModule()->PutModule("TEST!!!!");
}
};
@@ -67,7 +67,7 @@ class CSampleMod : public CModule {
public:
MODCONSTRUCTOR(CSampleMod) {}
virtual bool OnLoad(const CString& sArgs, CString& sMessage) {
virtual bool OnLoad(const CString& sArgs, CString& sMessage) override {
PutModule("I'm being loaded with the arguments: [" + sArgs + "]");
//AddTimer(new CSampleTimer(this, 300, 0, "Sample", "Sample timer for sample things."));
//AddTimer(new CSampleTimer(this, 5, 20, "Another", "Another sample timer."));
@@ -80,86 +80,86 @@ public:
PutModule("I'm being unloaded!");
}
virtual bool OnBoot() {
virtual bool OnBoot() override {
// This is called when the app starts up (only modules that are loaded in the config will get this event)
return true;
}
virtual void OnIRCConnected() {
virtual void OnIRCConnected() override {
PutModule("You got connected BoyOh.");
}
virtual void OnIRCDisconnected() {
virtual void OnIRCDisconnected() override {
PutModule("You got disconnected BoyOh.");
}
virtual EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName) {
virtual EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName) override {
sRealName += " - ZNC";
return CONTINUE;
}
virtual EModRet OnBroadcast(CString& sMessage) {
virtual EModRet OnBroadcast(CString& sMessage) override {
PutModule("------ [" + sMessage + "]");
sMessage = "======== [" + sMessage + "] ========";
return CONTINUE;
}
virtual void OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange) {
virtual void OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange) override {
PutModule(((bNoChange) ? "[0] [" : "[1] [") + OpNick.GetNick() + "] set mode [" + Channel.GetName() + ((bAdded) ? "] +" : "] -") + CString(uMode) + " " + Nick.GetNick());
}
virtual void OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {
virtual void OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) override {
PutModule(((bNoChange) ? "[0] [" : "[1] [") + OpNick.GetNick() + "] opped [" + Nick.GetNick() + "] on [" + Channel.GetName() + "]");
}
virtual void OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {
virtual void OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) override {
PutModule(((bNoChange) ? "[0] [" : "[1] [") + OpNick.GetNick() + "] deopped [" + Nick.GetNick() + "] on [" + Channel.GetName() + "]");
}
virtual void OnVoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {
virtual void OnVoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) override {
PutModule(((bNoChange) ? "[0] [" : "[1] [") + OpNick.GetNick() + "] voiced [" + Nick.GetNick() + "] on [" + Channel.GetName() + "]");
}
virtual void OnDevoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {
virtual void OnDevoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) override {
PutModule(((bNoChange) ? "[0] [" : "[1] [") + OpNick.GetNick() + "] devoiced [" + Nick.GetNick() + "] on [" + Channel.GetName() + "]");
}
virtual void OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs) {
virtual void OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs) override {
PutModule("* " + OpNick.GetNick() + " sets mode: " + sModes + " " + sArgs + " (" + Channel.GetName() + ")");
}
virtual EModRet OnRaw(CString& sLine) {
virtual EModRet OnRaw(CString& sLine) override {
// PutModule("OnRaw() [" + sLine + "]");
return CONTINUE;
}
virtual EModRet OnUserRaw(CString& sLine) {
virtual EModRet OnUserRaw(CString& sLine) override {
// PutModule("UserRaw() [" + sLine + "]");
return CONTINUE;
}
virtual void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) {
virtual void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) override {
PutModule("[" + OpNick.GetNick() + "] kicked [" + sKickedNick + "] from [" + Channel.GetName() + "] with the msg [" + sMessage + "]");
}
virtual void OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans) {
virtual void OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans) override {
PutModule("* Quits: " + Nick.GetNick() + " (" + Nick.GetIdent() + "!" + Nick.GetHost() + ") (" + sMessage + ")");
}
virtual EModRet OnTimerAutoJoin(CChan& Channel) {
virtual EModRet OnTimerAutoJoin(CChan& Channel) override {
PutModule("Attempting to join " + Channel.GetName());
return CONTINUE;
}
virtual void OnJoin(const CNick& Nick, CChan& Channel) {
virtual void OnJoin(const CNick& Nick, CChan& Channel) override {
PutModule("* Joins: " + Nick.GetNick() + " (" + Nick.GetIdent() + "!" + Nick.GetHost() + ")");
}
virtual void OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage) {
virtual void OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage) override {
PutModule("* Parts: " + Nick.GetNick() + " (" + Nick.GetIdent() + "!" + Nick.GetHost() + ")");
}
virtual EModRet OnInvite(const CNick& Nick, const CString& sChan) {
virtual EModRet OnInvite(const CNick& Nick, const CString& sChan) override {
if (sChan.Equals("#test")) {
PutModule(Nick.GetNick() + " invited us to " + sChan + ", ignoring invites to " + sChan);
return HALT;
@@ -169,91 +169,91 @@ public:
return CONTINUE;
}
virtual void OnNick(const CNick& OldNick, const CString& sNewNick, const vector<CChan*>& vChans) {
virtual void OnNick(const CNick& OldNick, const CString& sNewNick, const vector<CChan*>& vChans) override {
PutModule("* " + OldNick.GetNick() + " is now known as " + sNewNick);
}
virtual EModRet OnUserCTCPReply(CString& sTarget, CString& sMessage) {
virtual EModRet OnUserCTCPReply(CString& sTarget, CString& sMessage) override {
PutModule("[" + sTarget + "] userctcpreply [" + sMessage + "]");
sMessage = "\037" + sMessage + "\037";
return CONTINUE;
}
virtual EModRet OnCTCPReply(CNick& Nick, CString& sMessage) {
virtual EModRet OnCTCPReply(CNick& Nick, CString& sMessage) override {
PutModule("[" + Nick.GetNick() + "] ctcpreply [" + sMessage + "]");
return CONTINUE;
}
virtual EModRet OnUserCTCP(CString& sTarget, CString& sMessage) {
virtual EModRet OnUserCTCP(CString& sTarget, CString& sMessage) override {
PutModule("[" + sTarget + "] userctcp [" + sMessage + "]");
return CONTINUE;
}
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage) {
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage) override {
PutModule("[" + Nick.GetNick() + "] privctcp [" + sMessage + "]");
sMessage = "\002" + sMessage + "\002";
return CONTINUE;
}
virtual EModRet OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage) {
virtual EModRet OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage) override {
PutModule("[" + Nick.GetNick() + "] chanctcp [" + sMessage + "] to [" + Channel.GetName() + "]");
sMessage = "\00311,5 " + sMessage + " \003";
return CONTINUE;
}
virtual EModRet OnUserNotice(CString& sTarget, CString& sMessage) {
virtual EModRet OnUserNotice(CString& sTarget, CString& sMessage) override {
PutModule("[" + sTarget + "] usernotice [" + sMessage + "]");
sMessage = "\037" + sMessage + "\037";
return CONTINUE;
}
virtual EModRet OnPrivNotice(CNick& Nick, CString& sMessage) {
virtual EModRet OnPrivNotice(CNick& Nick, CString& sMessage) override {
PutModule("[" + Nick.GetNick() + "] privnotice [" + sMessage + "]");
sMessage = "\002" + sMessage + "\002";
return CONTINUE;
}
virtual EModRet OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage) {
virtual EModRet OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage) override {
PutModule("[" + Nick.GetNick() + "] channotice [" + sMessage + "] to [" + Channel.GetName() + "]");
sMessage = "\00311,5 " + sMessage + " \003";
return CONTINUE;
}
virtual EModRet OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) {
virtual EModRet OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) override {
PutModule("* " + Nick.GetNick() + " changes topic on " + Channel.GetName() + " to '" + sTopic + "'");
return CONTINUE;
}
virtual EModRet OnUserTopic(CString& sTarget, CString& sTopic) {
virtual EModRet OnUserTopic(CString& sTarget, CString& sTopic) override {
PutModule("* " + GetClient()->GetNick() + " changed topic on " + sTarget + " to '" + sTopic + "'");
return CONTINUE;
}
virtual EModRet OnUserMsg(CString& sTarget, CString& sMessage) {
virtual EModRet OnUserMsg(CString& sTarget, CString& sMessage) override {
PutModule("[" + sTarget + "] usermsg [" + sMessage + "]");
sMessage = "Sample: \0034" + sMessage + "\003";
return CONTINUE;
}
virtual EModRet OnPrivMsg(CNick& Nick, CString& sMessage) {
virtual EModRet OnPrivMsg(CNick& Nick, CString& sMessage) override {
PutModule("[" + Nick.GetNick() + "] privmsg [" + sMessage + "]");
sMessage = "\002" + sMessage + "\002";
return CONTINUE;
}
virtual EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) {
virtual EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) override {
if (sMessage == "!ping") {
PutIRC("PRIVMSG " + Channel.GetName() + " :PONG?");
}
@@ -265,13 +265,13 @@ public:
return CONTINUE;
}
virtual void OnModCommand(const CString& sCommand) {
virtual void OnModCommand(const CString& sCommand) override {
if (sCommand.Equals("TIMERS")) {
ListTimers();
}
}
virtual EModRet OnStatusCommand(CString& sCommand) {
virtual EModRet OnStatusCommand(CString& sCommand) override {
if (sCommand.Equals("SAMPLE")) {
PutModule("Hi, I'm your friendly sample module.");
return HALT;