Add clang-format configuration.

For now, it uses tabs like before, to make the diff easier to read/check.
One of following commits will switch it to spaces.
This commit is contained in:
Alexey Sokolov
2015-12-06 22:36:35 +00:00
parent 02f8749a8b
commit 33b0627d75
132 changed files with 12743 additions and 8904 deletions
+26 -17
View File
@@ -25,35 +25,40 @@
#include <znc/Chan.h>
#include <znc/IRCNetwork.h>
class CRejoinJob: public CTimer {
public:
CRejoinJob(CModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {
}
class CRejoinJob : public CTimer {
public:
CRejoinJob(CModule* pModule, unsigned int uInterval, unsigned int uCycles,
const CString& sLabel, const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
virtual ~CRejoinJob() {}
protected:
protected:
void RunJob() override {
CIRCNetwork* pNetwork = GetModule()->GetNetwork();
CChan* pChan = pNetwork->FindChan(GetName().Token(1, true));
if (pChan) {
pChan->Enable();
GetModule()->PutIRC("JOIN " + pChan->GetName() + " " + pChan->GetKey());
GetModule()->PutIRC("JOIN " + pChan->GetName() + " " +
pChan->GetKey());
}
}
};
class CRejoinMod : public CModule {
private:
private:
unsigned int delay = 10;
public:
public:
MODCONSTRUCTOR(CRejoinMod) {
AddHelpCommand();
AddCommand("SetDelay", static_cast<CModCommand::ModCmdFunc>(&CRejoinMod::OnSetDelayCommand), "<secs>", "Set the rejoin delay");
AddCommand("ShowDelay", static_cast<CModCommand::ModCmdFunc>(&CRejoinMod::OnShowDelayCommand), "", "Show the rejoin delay");
AddCommand("SetDelay", static_cast<CModCommand::ModCmdFunc>(
&CRejoinMod::OnSetDelayCommand),
"<secs>", "Set the rejoin delay");
AddCommand("ShowDelay", static_cast<CModCommand::ModCmdFunc>(
&CRejoinMod::OnShowDelayCommand),
"", "Show the rejoin delay");
}
virtual ~CRejoinMod() {}
@@ -70,8 +75,9 @@ public:
if ((i == 0 && sArgs == "0") || i > 0)
delay = i;
else {
sErrorMsg = "Illegal argument, "
"must be a positive number or 0";
sErrorMsg =
"Illegal argument, "
"must be a positive number or 0";
return false;
}
}
@@ -104,7 +110,8 @@ public:
PutModule("Rejoin delay disabled");
}
void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& pChan, const CString& sMessage) override {
void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& pChan,
const CString& sMessage) override {
if (GetNetwork()->GetCurNick().Equals(sKickedNick)) {
if (!delay) {
PutIRC("JOIN " + pChan.GetName() + " " + pChan.GetKey());
@@ -112,15 +119,17 @@ public:
return;
}
AddTimer(new CRejoinJob(this, delay, 1, "Rejoin " + pChan.GetName(),
"Rejoin channel after a delay"));
"Rejoin channel after a delay"));
}
}
};
template<> void TModInfo<CRejoinMod>(CModInfo& Info) {
template <>
void TModInfo<CRejoinMod>(CModInfo& Info) {
Info.SetWikiPage("kickrejoin");
Info.SetHasArgs(true);
Info.SetArgsHelpText("You might enter the number of seconds to wait before rejoining.");
Info.SetArgsHelpText(
"You might enter the number of seconds to wait before rejoining.");
}
NETWORKMODULEDEFS(CRejoinMod, "Autorejoin on kick")