mirror of
https://github.com/znc/znc.git
synced 2026-08-10 02:43:05 +02:00
clang-format: switch tabs to spaces
I like tabs, but I have to admit that spaces make source code more consistent, because every editor/viewer tends to render tabs differently :(
This commit is contained in:
+36
-36
@@ -18,54 +18,54 @@
|
||||
|
||||
class CBlockMotd : public CModule {
|
||||
public:
|
||||
MODCONSTRUCTOR(CBlockMotd) {
|
||||
AddHelpCommand();
|
||||
AddCommand("GetMotd", static_cast<CModCommand::ModCmdFunc>(
|
||||
&CBlockMotd::OverrideCommand),
|
||||
"[<server>]",
|
||||
"Override the block with this command. Can optionally "
|
||||
"specify which server to query.");
|
||||
}
|
||||
MODCONSTRUCTOR(CBlockMotd) {
|
||||
AddHelpCommand();
|
||||
AddCommand("GetMotd", static_cast<CModCommand::ModCmdFunc>(
|
||||
&CBlockMotd::OverrideCommand),
|
||||
"[<server>]",
|
||||
"Override the block with this command. Can optionally "
|
||||
"specify which server to query.");
|
||||
}
|
||||
|
||||
virtual ~CBlockMotd() {}
|
||||
virtual ~CBlockMotd() {}
|
||||
|
||||
void OverrideCommand(const CString& sLine) {
|
||||
m_bTemporaryAcceptMotd = true;
|
||||
const CString sServer = sLine.Token(1);
|
||||
void OverrideCommand(const CString& sLine) {
|
||||
m_bTemporaryAcceptMotd = true;
|
||||
const CString sServer = sLine.Token(1);
|
||||
|
||||
if (sServer.empty()) {
|
||||
PutIRC("motd");
|
||||
} else {
|
||||
PutIRC("motd " + sServer);
|
||||
}
|
||||
}
|
||||
if (sServer.empty()) {
|
||||
PutIRC("motd");
|
||||
} else {
|
||||
PutIRC("motd " + sServer);
|
||||
}
|
||||
}
|
||||
|
||||
EModRet OnRaw(CString& sLine) override {
|
||||
const CString sCmd = sLine.Token(1);
|
||||
EModRet OnRaw(CString& sLine) override {
|
||||
const CString sCmd = sLine.Token(1);
|
||||
|
||||
if ((sCmd == "375" /* begin of MOTD */ || sCmd == "372" /* MOTD */) &&
|
||||
!m_bTemporaryAcceptMotd)
|
||||
return HALT;
|
||||
if ((sCmd == "375" /* begin of MOTD */ || sCmd == "372" /* MOTD */) &&
|
||||
!m_bTemporaryAcceptMotd)
|
||||
return HALT;
|
||||
|
||||
if (sCmd == "376" /* End of MOTD */) {
|
||||
if (!m_bTemporaryAcceptMotd) {
|
||||
sLine = sLine.Token(0) + " 422 " + sLine.Token(2) +
|
||||
" :MOTD blocked by ZNC";
|
||||
}
|
||||
m_bTemporaryAcceptMotd = false;
|
||||
}
|
||||
return CONTINUE;
|
||||
}
|
||||
if (sCmd == "376" /* End of MOTD */) {
|
||||
if (!m_bTemporaryAcceptMotd) {
|
||||
sLine = sLine.Token(0) + " 422 " + sLine.Token(2) +
|
||||
" :MOTD blocked by ZNC";
|
||||
}
|
||||
m_bTemporaryAcceptMotd = false;
|
||||
}
|
||||
return CONTINUE;
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_bTemporaryAcceptMotd = false;
|
||||
bool m_bTemporaryAcceptMotd = false;
|
||||
};
|
||||
|
||||
template <>
|
||||
void TModInfo<CBlockMotd>(CModInfo& Info) {
|
||||
Info.AddType(CModInfo::NetworkModule);
|
||||
Info.AddType(CModInfo::GlobalModule);
|
||||
Info.SetWikiPage("block_motd");
|
||||
Info.AddType(CModInfo::NetworkModule);
|
||||
Info.AddType(CModInfo::GlobalModule);
|
||||
Info.SetWikiPage("block_motd");
|
||||
}
|
||||
|
||||
USERMODULEDEFS(CBlockMotd,
|
||||
|
||||
Reference in New Issue
Block a user