diff --git a/Client.cpp b/Client.cpp index 3128c397..c7ebff5f 100644 --- a/Client.cpp +++ b/Client.cpp @@ -14,36 +14,36 @@ #include "znc.h" #include "WebModules.h" -#define CALLMOD(MOD, CLIENT, USER, FUNC) { \ - CModule* pModule = CZNC::Get().GetModules().FindModule(MOD); \ - if (pModule) { \ - try { \ - pModule->SetClient(CLIENT); \ - pModule->SetUser(USER); \ - pModule->FUNC; \ - pModule->SetClient(NULL); \ - pModule->SetUser(NULL); \ - } catch (CModule::EModException e) { \ - if (e == CModule::UNLOAD) { \ - CZNC::Get().GetModules().UnloadModule(MOD); \ - } \ - } \ - } else { \ - pModule = (USER)->GetModules().FindModule(MOD); \ - if (pModule) { \ - try { \ - pModule->SetClient(CLIENT); \ - pModule->FUNC; \ - pModule->SetClient(NULL); \ - } catch (CModule::EModException e) { \ - if (e == CModule::UNLOAD) { \ - (USER)->GetModules().UnloadModule(MOD); \ - } \ - } \ - } else { \ - PutStatus("No such module [" + MOD + "]"); \ - } \ - } \ +#define CALLMOD(MOD, CLIENT, USER, FUNC) { \ + CModule* pModule = CZNC::Get().GetModules().FindModule(MOD); \ + if (pModule) { \ + try { \ + pModule->SetClient(CLIENT); \ + pModule->SetUser(USER); \ + pModule->FUNC; \ + pModule->SetClient(NULL); \ + pModule->SetUser(NULL); \ + } catch (CModule::EModException e) { \ + if (e == CModule::UNLOAD) { \ + CZNC::Get().GetModules().UnloadModule(MOD); \ + } \ + } \ + } else { \ + pModule = (USER)->GetModules().FindModule(MOD); \ + if (pModule) { \ + try { \ + pModule->SetClient(CLIENT); \ + pModule->FUNC; \ + pModule->SetClient(NULL); \ + } catch (CModule::EModException e) { \ + if (e == CModule::UNLOAD) { \ + (USER)->GetModules().UnloadModule(MOD); \ + } \ + } \ + } else { \ + PutStatus("No such module [" + MOD + "]"); \ + } \ + } \ } CClient::~CClient() { @@ -96,7 +96,7 @@ void CClient::ReadLine(const CString& sData) { AuthUser(); } - return; // Don't forward this msg. ZNC has already registered us. + return; // Don't forward this msg. ZNC has already registered us. } } else if (sCommand.Equals("NICK")) { CString sNick = sLine.Token(1); @@ -111,7 +111,7 @@ void CClient::ReadLine(const CString& sData) { if ((m_bGotPass) && (m_bGotUser)) { AuthUser(); } - return; // Don't forward this msg. ZNC will handle nick changes until auth is complete + return; // Don't forward this msg. ZNC will handle nick changes until auth is complete } } else if (sCommand.Equals("USER")) { if (!IsAttached()) { @@ -129,7 +129,7 @@ void CClient::ReadLine(const CString& sData) { "Try /quote PASS :"); } - return; // Don't forward this msg. ZNC has already registered us. + return; // Don't forward this msg. ZNC has already registered us. } } @@ -189,7 +189,7 @@ void CClient::ReadLine(const CString& sData) { return; } } else if (sCommand.Equals("PONG")) { - return; // Block pong replies, we already responded to the pings + return; // Block pong replies, we already responded to the pings } else if (sCommand.Equals("JOIN")) { CString sChans = sLine.Token(1); CString sKey = sLine.Token(2); @@ -287,8 +287,8 @@ void CClient::ReadLine(const CString& sData) { } else if (sCommand.Equals("QUIT")) { m_pUser->UserDisconnected(this); - Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach - return; // Don't forward this msg. We don't want the client getting us disconnected. + Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach + return; // Don't forward this msg. We don't want the client getting us disconnected. } else if (sCommand.Equals("PROTOCTL")) { VCString vsTokens; VCString::const_iterator it; @@ -301,7 +301,7 @@ void CClient::ReadLine(const CString& sData) { m_bUHNames = true; } } - return; // If the server understands it, we already enabled namesx / uhnames + return; // If the server understands it, we already enabled namesx / uhnames } else if (sCommand.Equals("NOTICE")) { CString sTarget = sLine.Token(1); CString sMsg = sLine.Token(2, true); diff --git a/IRCSock.cpp b/IRCSock.cpp index beebd139..89beb693 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -106,7 +106,7 @@ void CIRCSock::ReadLine(const CString& sData) { CString sRest = sLine.Token(3, true); switch (uRaw) { - case 1: {// :irc.server.com 001 nick :Welcome to the Internet Relay Network nick + case 1: { // :irc.server.com 001 nick :Welcome to the Internet Relay Network nick if (m_bAuthed && sServer == "irc.znc.in") { // m_bAuthed == true => we already received another 001 => we might be in a traffic loop m_pUser->PutStatus("ZNC seems to be connected to itself, disconnecting..."); @@ -115,7 +115,7 @@ void CIRCSock::ReadLine(const CString& sData) { } m_pUser->SetIRCServer(sServer); - SetTimeout(240, TMO_READ); // Now that we are connected, let nature take its course + SetTimeout(240, TMO_READ); // Now that we are connected, let nature take its course PutIRC("WHO " + sNick); m_bAuthed = true; @@ -152,13 +152,13 @@ void CIRCSock::ReadLine(const CString& sData) { case 2: case 3: case 4: - case 250: // highest connection count - case 251: // user count - case 252: // oper count - case 254: // channel count - case 255: // client count - case 265: // local users - case 266: // global users + case 250: // highest connection count + case 251: // user count + case 252: // oper count + case 254: // channel count + case 255: // client count + case 265: // local users + case 266: // global users m_pUser->UpdateRawBuffer(":" + sServer + " " + sCmd + " ", " " + sRest); break; case 305: @@ -167,7 +167,7 @@ void CIRCSock::ReadLine(const CString& sData) { case 306: m_pUser->SetIRCAway(true); break; - case 324: { // MODE + case 324: { // MODE sRest.Trim(); CChan* pChan = m_pUser->FindChan(sRest.Token(0)); @@ -247,7 +247,7 @@ void CIRCSock::ReadLine(const CString& sData) { break; } - case 353: { // NAMES + case 353: { // NAMES sRest.Trim(); // Todo: allow for non @+= server msgs CChan* pChan = m_pUser->FindChan(sRest.Token(1)); @@ -267,8 +267,8 @@ void CIRCSock::ReadLine(const CString& sData) { // We forwarded it already, so return return; } - case 366: { // end of names list - m_pUser->PutUser(sLine); // First send them the raw + case 366: { // end of names list + m_pUser->PutUser(sLine); // First send them the raw // :irc.server.com 366 nick #chan :End of /NAMES list. CChan* pChan = m_pUser->FindChan(sRest.Token(0)); @@ -290,13 +290,13 @@ void CIRCSock::ReadLine(const CString& sData) { } } - return; // return so we don't send them the raw twice + return; // return so we don't send them the raw twice } - case 375: // begin motd - case 422: // MOTD File is missing + case 375: // begin motd + case 422: // MOTD File is missing m_pUser->ClearMotdBuffer(); - case 372: // motd - case 376: // end motd + case 372: // motd + case 376: // end motd m_pUser->AddMotdBuffer(":" + sServer + " " + sCmd + " ", " " + sRest); break; case 437: @@ -487,7 +487,6 @@ void CIRCSock::ReadLine(const CString& sData) { } } else if (sTarget == m_Nick.GetNick()) { CString sModeArg = sModes.Token(0); -// CString sArgs = sModes.Token(1, true); Usermode changes got no params bool bAdd = true; /* no module call defined (yet?) MODULECALL(OnRawUserMode(*pOpNick, *this, sModeArg, sArgs), m_pUser, NULL, ); diff --git a/Modules.cpp b/Modules.cpp index 0b07f200..24b3ccb7 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -18,62 +18,62 @@ # warning "your crap box doesnt define RTLD_LOCAL !?" #endif -#define _MODUNLOADCHK(func, type) \ - for (unsigned int a = 0; a < size(); a++) { \ - try { \ - type* pMod = (type *) (*this)[a]; \ - CClient* pOldClient = pMod->GetClient(); \ - pMod->SetClient(m_pClient); \ - if (m_pUser) { \ - CUser* pOldUser = pMod->GetUser(); \ - pMod->SetUser(m_pUser); \ - pMod->func; \ - pMod->SetUser(pOldUser); \ - } else { \ - pMod->func; \ - } \ - pMod->SetClient(pOldClient); \ - } catch (CModule::EModException e) { \ - if (e == CModule::UNLOAD) { \ - UnloadModule((*this)[a]->GetModName()); \ - } \ - } \ +#define _MODUNLOADCHK(func, type) \ + for (unsigned int a = 0; a < size(); a++) { \ + try { \ + type* pMod = (type *) (*this)[a]; \ + CClient* pOldClient = pMod->GetClient(); \ + pMod->SetClient(m_pClient); \ + if (m_pUser) { \ + CUser* pOldUser = pMod->GetUser(); \ + pMod->SetUser(m_pUser); \ + pMod->func; \ + pMod->SetUser(pOldUser); \ + } else { \ + pMod->func; \ + } \ + pMod->SetClient(pOldClient); \ + } catch (CModule::EModException e) { \ + if (e == CModule::UNLOAD) { \ + UnloadModule((*this)[a]->GetModName()); \ + } \ + } \ } #define MODUNLOADCHK(func) _MODUNLOADCHK(func, CModule) #define GLOBALMODCALL(func) _MODUNLOADCHK(func, CGlobalModule) -#define _MODHALTCHK(func, type) \ - bool bHaltCore = false; \ - for (unsigned int a = 0; a < size(); a++) { \ - try { \ - type* pMod = (type*) (*this)[a]; \ - CModule::EModRet e = CModule::CONTINUE; \ - CClient* pOldClient = pMod->GetClient(); \ - pMod->SetClient(m_pClient); \ - if (m_pUser) { \ - CUser* pOldUser = pMod->GetUser(); \ - pMod->SetUser(m_pUser); \ - e = pMod->func; \ - pMod->SetUser(pOldUser); \ - } else { \ - e = pMod->func; \ - } \ - pMod->SetClient(pOldClient); \ - if (e == CModule::HALTMODS) { \ - break; \ - } else if (e == CModule::HALTCORE) { \ - bHaltCore = true; \ - } else if (e == CModule::HALT) { \ - bHaltCore = true; \ - break; \ - } \ - } catch (CModule::EModException e) { \ - if (e == CModule::UNLOAD) { \ - UnloadModule((*this)[a]->GetModName()); \ - } \ - } \ - } \ +#define _MODHALTCHK(func, type) \ + bool bHaltCore = false; \ + for (unsigned int a = 0; a < size(); a++) { \ + try { \ + type* pMod = (type*) (*this)[a]; \ + CModule::EModRet e = CModule::CONTINUE; \ + CClient* pOldClient = pMod->GetClient(); \ + pMod->SetClient(m_pClient); \ + if (m_pUser) { \ + CUser* pOldUser = pMod->GetUser(); \ + pMod->SetUser(m_pUser); \ + e = pMod->func; \ + pMod->SetUser(pOldUser); \ + } else { \ + e = pMod->func; \ + } \ + pMod->SetClient(pOldClient); \ + if (e == CModule::HALTMODS) { \ + break; \ + } else if (e == CModule::HALTCORE) { \ + bHaltCore = true; \ + } else if (e == CModule::HALT) { \ + bHaltCore = true; \ + break; \ + } \ + } catch (CModule::EModException e) { \ + if (e == CModule::UNLOAD) { \ + UnloadModule((*this)[a]->GetModName()); \ + } \ + } \ + } \ return bHaltCore; #define MODHALTCHK(func) _MODHALTCHK(func, CModule) @@ -751,7 +751,7 @@ bool CModules::UnloadModule(const CString& sModule) { } bool CModules::UnloadModule(const CString& sModule, CString& sRetMsg) { - CString sMod = sModule; // Make a copy incase the reference passed in is from CModule::GetModName() + CString sMod = sModule; // Make a copy incase the reference passed in is from CModule::GetModName() CModule* pModule = FindModule(sMod); sRetMsg = ""; @@ -804,7 +804,7 @@ bool CModules::UnloadModule(const CString& sModule, CString& sRetMsg) { } bool CModules::ReloadModule(const CString& sModule, const CString& sArgs, CUser* pUser, CString& sRetMsg) { - CString sMod = sModule; // Make a copy incase the reference passed in is from CModule::GetModName() + CString sMod = sModule; // Make a copy incase the reference passed in is from CModule::GetModName() sRetMsg = ""; if (!UnloadModule(sMod, sRetMsg)) { return false; diff --git a/Template.cpp b/Template.cpp index 7b937f92..2d53c9ef 100644 --- a/Template.cpp +++ b/Template.cpp @@ -173,7 +173,7 @@ void CTemplate::RemovePath(const CString& sPath) { for (list >::iterator it = m_lsbPaths.begin(); it != m_lsbPaths.end(); ++it) { if (it->first == sPath) { m_lsbPaths.remove(*it); - RemovePath(sPath); // @todo probably shouldn't use recursion, being lazy + RemovePath(sPath); // @todo probably shouldn't use recursion, being lazy return; } } diff --git a/User.cpp b/User.cpp index 0dea84fc..c45a352f 100644 --- a/User.cpp +++ b/User.cpp @@ -60,8 +60,8 @@ CUser::CUser(const CString& sUserName) { m_uBytesRead = 0; m_uBytesWritten = 0; m_pModules = new CModules; - m_RawBuffer.SetLineCount(100); // This should be more than enough raws, especially since we are buffering the MOTD separately - m_MotdBuffer.SetLineCount(200); // This should be more than enough motd lines + m_RawBuffer.SetLineCount(100); // This should be more than enough raws, especially since we are buffering the MOTD separately + m_MotdBuffer.SetLineCount(200); // This should be more than enough motd lines m_bMultiClients = true; m_bBounceDCCs = true; m_eHashType = HASH_NONE; @@ -913,7 +913,7 @@ CServer* CUser::GetNextServer() { m_uServerIdx = 0; } - return m_vServers[m_uServerIdx++]; // Todo: cycle through these + return m_vServers[m_uServerIdx++]; } CServer* CUser::GetCurrentServer() const { diff --git a/WebModules.cpp b/WebModules.cpp index f5f0c1bf..d3d9b26a 100644 --- a/WebModules.cpp +++ b/WebModules.cpp @@ -362,7 +362,7 @@ bool CWebSock::AddModLoop(const CString& sLoopName, CModule& Module) { bool bActive = (m_sModName == Module.GetModName() && m_sPage == SubPage->GetName()); if (SubPage->RequiresAdmin() && !GetSession()->IsAdmin()) { - continue; // Don't add admin-only subpages to requests from non-admin users + continue; // Don't add admin-only subpages to requests from non-admin users } CTemplate& SubRow = Row.AddRow("SubPageLoop"); diff --git a/ZNCString.cpp b/ZNCString.cpp index f24520fe..7dcab833 100644 --- a/ZNCString.cpp +++ b/ZNCString.cpp @@ -194,7 +194,7 @@ CString CString::Escape_n(EEscape eFrom, EEscape eTo) const { if ((*p == '&') && (strnchr((unsigned char*) p, ';', sizeof(pTmp) - 1, pTmp, &iCounted))) { // please note that we do not have any Unicode or UTF-8 support here at all. - if ((iCounted >= 3) && (pTmp[1] == '#')) { // do XML and HTML a < + if ((iCounted >= 3) && (pTmp[1] == '#')) { // do XML and HTML a < int base = 10; if ((pTmp[2] & 0xDF) == 'X') { @@ -221,7 +221,7 @@ CString CString::Escape_n(EEscape eFrom, EEscape eTo) const { if (ch > 0) { a += iCounted; } else { - ch = *p; // Not a valid escape, just record the & + ch = *p; // Not a valid escape, just record the & } } else { ch = *p; @@ -884,10 +884,10 @@ CString CString::ToTimeStr(unsigned long s) { const unsigned long y = d * 365; CString sRet; -#define TIMESPAN(time, str) \ - if (s >= time) { \ +#define TIMESPAN(time, str) \ + if (s >= time) { \ sRet += CString(s / time) + str " "; \ - s = s % time; \ + s = s % time; \ } TIMESPAN(y, "y"); TIMESPAN(w, "w"); diff --git a/main.cpp b/main.cpp index 56554cd7..ac34bc9b 100644 --- a/main.cpp +++ b/main.cpp @@ -11,18 +11,18 @@ #include static const struct option g_LongOpts[] = { - { "help", no_argument, 0, 'h' }, - { "version", no_argument, 0, 'v' }, - { "debug", no_argument, 0, 'D' }, - { "foreground", no_argument, 0, 'f' }, - { "no-color", no_argument, 0, 'n' }, - { "allow-root", no_argument, 0, 'r' }, - { "makeconf", no_argument, 0, 'c' }, - { "makepass", no_argument, 0, 's' }, + { "help", no_argument, 0, 'h' }, + { "version", no_argument, 0, 'v' }, + { "debug", no_argument, 0, 'D' }, + { "foreground", no_argument, 0, 'f' }, + { "no-color", no_argument, 0, 'n' }, + { "allow-root", no_argument, 0, 'r' }, + { "makeconf", no_argument, 0, 'c' }, + { "makepass", no_argument, 0, 's' }, #ifdef HAVE_LIBSSL - { "makepem", no_argument, 0, 'p' }, + { "makepem", no_argument, 0, 'p' }, #endif /* HAVE_LIBSSL */ - { "datadir", required_argument, 0, 'd' }, + { "datadir", required_argument, 0, 'd' }, { 0, 0, 0, 0 } }; diff --git a/modules/admin.cpp b/modules/admin.cpp index cb09a213..ffe0d0e2 100644 --- a/modules/admin.cpp +++ b/modules/admin.cpp @@ -614,7 +614,7 @@ class CAdminMod : public CModule { PutModule("Loading modules has been denied"); return; } - + CModule *pMod = (pUser)->GetModules().FindModule(sModName); if (!pMod) { if (!(pUser)->GetModules().LoadModule(sModName, sArgs, pUser, sModRet, false)) { @@ -647,11 +647,11 @@ class CAdminMod : public CModule { CUser* pUser = GetUser(sUsername); if (!pUser) return; - + if (pUser->DenyLoadMod() && !m_pUser->IsAdmin()) { PutModule("Loading modules has been denied"); return; - } + } if (!(pUser)->GetModules().UnloadModule(sModName, sModRet)) { PutModule("Unable to unload module [" + sModName + "] [" + sModRet + "]"); diff --git a/modules/adminlog.cpp b/modules/adminlog.cpp index 01ecd631..bf384bf5 100644 --- a/modules/adminlog.cpp +++ b/modules/adminlog.cpp @@ -158,8 +158,8 @@ private: LOG_TO_SYSLOG = 1 << 1, LOG_TO_BOTH = LOG_TO_FILE | LOG_TO_SYSLOG }; - LogMode m_eLogMode; - CString m_sLogFile; + LogMode m_eLogMode; + CString m_sLogFile; }; GLOBALMODULEDEFS(CAdminLogMod, "Log ZNC events to file and/or syslog.") diff --git a/modules/autoattach.cpp b/modules/autoattach.cpp index 5ec5c806..92b23e69 100644 --- a/modules/autoattach.cpp +++ b/modules/autoattach.cpp @@ -212,8 +212,8 @@ public: return false; } private: - vector m_vsChans; - vector m_vsNegChans; + vector m_vsChans; + vector m_vsNegChans; }; MODULEDEFS(CChanAttach, "Reattaches you to channels on activity.") diff --git a/modules/autocycle.cpp b/modules/autocycle.cpp index 35ff7e98..f7e5bfff 100644 --- a/modules/autocycle.cpp +++ b/modules/autocycle.cpp @@ -220,8 +220,8 @@ protected: } private: - vector m_vsChans; - vector m_vsNegChans; + vector m_vsChans; + vector m_vsNegChans; }; MODULEDEFS(CAutoCycleMod, "Rejoins channels to gain Op if you're the only user left") diff --git a/modules/autoop.cpp b/modules/autoop.cpp index f50f5bb7..9d828b7e 100644 --- a/modules/autoop.cpp +++ b/modules/autoop.cpp @@ -11,7 +11,7 @@ class CAutoOpMod; -#define AUTOOP_CHALLENGE_LENGTH 32 +#define AUTOOP_CHALLENGE_LENGTH 32 class CAutoOpTimer : public CTimer { public: @@ -27,7 +27,7 @@ private: protected: virtual void RunJob(); - CAutoOpMod* m_pParent; + CAutoOpMod* m_pParent; }; class CAutoOpUser { @@ -121,10 +121,10 @@ public: } private: protected: - CString m_sUsername; - CString m_sUserKey; - CString m_sHostmask; - set m_ssChans; + CString m_sUsername; + CString m_sUserKey; + CString m_sHostmask; + set m_ssChans; }; class CAutoOpMod : public CModule { @@ -452,8 +452,8 @@ public: } } private: - map m_msUsers; - MCString m_msQueue; + map m_msUsers; + MCString m_msQueue; }; void CAutoOpTimer::RunJob() { diff --git a/modules/autoreply.cpp b/modules/autoreply.cpp index e6972828..ca97d927 100644 --- a/modules/autoreply.cpp +++ b/modules/autoreply.cpp @@ -85,7 +85,7 @@ public: } private: - TCacheMap m_Messaged; + TCacheMap m_Messaged; }; MODULEDEFS(CAutoReplyMod, "Reply to queries when you are away") diff --git a/modules/away.cpp b/modules/away.cpp index 9b6bbb75..83f5dc25 100644 --- a/modules/away.cpp +++ b/modules/away.cpp @@ -83,7 +83,7 @@ public: if (m_bIsAway) Away(true); // reset away if we are reconnected else - Back(); // ircd seems to remember your away if you killed the client and came back + Back(); // ircd seems to remember your away if you killed the client and came back } bool BootStrap() @@ -367,8 +367,8 @@ public: bool IsAway() { return(m_bIsAway); } private: - CString m_sPassword; - bool m_bBootError; + CString m_sPassword; + bool m_bBootError; bool DecryptMessages(CString & sBuffer) { CString sMessages = GetPath(); @@ -413,11 +413,11 @@ private: m_vMessages.push_back(sText); } - time_t m_iLastSentData; - bool m_bIsAway; - time_t m_iAutoAway; - vector m_vMessages; - CString m_sReason; + time_t m_iLastSentData; + bool m_bIsAway; + time_t m_iAutoAway; + vector m_vMessages; + CString m_sReason; }; diff --git a/modules/awaynick.cpp b/modules/awaynick.cpp index 00f30542..4ef4610e 100644 --- a/modules/awaynick.cpp +++ b/modules/awaynick.cpp @@ -20,7 +20,7 @@ private: virtual void RunJob(); private: - CAwayNickMod& m_Module; + CAwayNickMod& m_Module; }; class CBackNickTimer : public CTimer { @@ -40,7 +40,7 @@ private: } private: - CModule& m_Module; + CModule& m_Module; }; class CAwayNickMod : public CModule { @@ -170,8 +170,8 @@ public: } private: - CString m_sFormat; - CString m_sAwayNick; + CString m_sFormat; + CString m_sAwayNick; }; CAwayNickTimer::CAwayNickTimer(CAwayNickMod& Module) diff --git a/modules/chansaver.cpp b/modules/chansaver.cpp index a60c4d40..85fae722 100644 --- a/modules/chansaver.cpp +++ b/modules/chansaver.cpp @@ -68,7 +68,7 @@ public: } private: - bool m_bWriteConf; + bool m_bWriteConf; }; MODULEDEFS(CChanSaverMod, "Keep config up-to-date when user joins/parts") diff --git a/modules/extra/autovoice.cpp b/modules/extra/autovoice.cpp index 831a2d63..47521a5b 100644 --- a/modules/extra/autovoice.cpp +++ b/modules/extra/autovoice.cpp @@ -97,9 +97,9 @@ public: } private: protected: - CString m_sUsername; - CString m_sHostmask; - set m_ssChans; + CString m_sUsername; + CString m_sHostmask; + set m_ssChans; }; class CAutoVoiceMod : public CModule { @@ -271,7 +271,7 @@ public: } private: - map m_msUsers; + map m_msUsers; }; MODULEDEFS(CAutoVoiceMod, "Auto voice the good guys") diff --git a/modules/extra/email.cpp b/modules/extra/email.cpp index 91ead482..cc574f9c 100644 --- a/modules/extra/email.cpp +++ b/modules/extra/email.cpp @@ -18,10 +18,10 @@ using std::stringstream; struct EmailST { - CString sFrom; - CString sSubject; - CString sUidl; - u_int iSize; + CString sFrom; + CString sSubject; + CString sUidl; + u_int iSize; }; class CEmailJob : public CTimer @@ -114,7 +114,7 @@ public: ssUidls.insert(vEmails[a].sUidl); } - m_ssUidls = ssUidls; // keep the list in synch + m_ssUidls = ssUidls; // keep the list in synch if (Table.size()) { PutModule(Table); @@ -127,10 +127,10 @@ public: } private: - CString m_sMailPath; - time_t m_iLastCheck; - set m_ssUidls; - bool m_bInitialized; + CString m_sMailPath; + time_t m_iLastCheck; + set m_ssUidls; + bool m_bInitialized; }; class CEmailFolder : public CSocket @@ -146,7 +146,7 @@ public: virtual ~CEmailFolder() { if (!m_sMailBuffer.empty()) - ProcessMail(); // get the last one + ProcessMail(); // get the last one if (!m_vEmails.empty()) m_pModule->ParseEmails(m_vEmails); @@ -178,7 +178,7 @@ public: CString sLine(*it); sLine.Trim(); if (sLine.empty()) - break; // out of the headers + break; // out of the headers if (sLine.Equals("From: ", false, 6)) tmp.sFrom = sLine.substr(6, CString::npos); @@ -192,10 +192,10 @@ public: m_vEmails.push_back(tmp); } private: - CEmail *m_pModule; - CString m_sMailbox; - CString m_sMailBuffer; - vector m_vEmails; + CEmail *m_pModule; + CString m_sMailbox; + CString m_sMailBuffer; + vector m_vEmails; }; void CEmail::OnModCommand(const CString& sCommand) @@ -222,17 +222,17 @@ void CEmail::StartParser() CString sParserName = "EMAIL::" + m_pUser->GetUserName(); if (m_pManager->FindSockByName(sParserName)) - return; // one at a time sucker + return; // one at a time sucker CFile cFile(m_sMailPath); if ((!cFile.Exists()) || (cFile.GetSize() == 0)) { m_bInitialized = true; - return; // der + return; // der } if (cFile.GetMTime() <= m_iLastCheck) - return; // only check if modified + return; // only check if modified int iFD = open(m_sMailPath.c_str(), O_RDONLY); if (iFD >= 0) diff --git a/modules/extra/imapauth.cpp b/modules/extra/imapauth.cpp index 6184ffaa..7ec6b632 100644 --- a/modules/extra/imapauth.cpp +++ b/modules/extra/imapauth.cpp @@ -32,10 +32,10 @@ public: virtual void ReadLine(const CString& sLine); private: protected: - CIMAPAuthMod* m_pIMAPMod; - bool m_bSentLogin; - bool m_bSentReply; - CSmartPtr m_spAuth; + CIMAPAuthMod* m_pIMAPMod; + bool m_bSentLogin; + bool m_bSentReply; + CSmartPtr m_spAuth; }; @@ -56,7 +56,7 @@ public: virtual bool OnLoad(const CString& sArgs, CString& sMessage) { if (sArgs.Trim_n().empty()) { - return true; // use defaults + return true; // use defaults } m_sServer = sArgs.Token(0); @@ -80,7 +80,7 @@ public: virtual EModRet OnLoginAttempt(CSmartPtr Auth) { CUser* pUser = CZNC::Get().FindUser(Auth->GetUsername()); - if (!pUser) { // @todo Will want to do some sort of && !m_bAllowCreate in the future + if (!pUser) { // @todo Will want to do some sort of && !m_bAllowCreate in the future Auth->RefuseLogin("Invalid User - Halting IMAP Lookup"); return HALT; } @@ -109,13 +109,13 @@ public: // !Getters private: // Settings - CString m_sServer; - unsigned short m_uPort; - bool m_bSSL; - CString m_sUserFormat; + CString m_sServer; + unsigned short m_uPort; + bool m_bSSL; + CString m_sUserFormat; // !Settings - TCacheMap m_Cache; + TCacheMap m_Cache; }; void CIMAPSock::ReadLine(const CString& sLine) { @@ -139,7 +139,7 @@ void CIMAPSock::ReadLine(const CString& sLine) { if (pUser && sLine.Equals("AUTH OK", false, 7)) { m_spAuth->AcceptLogin(*pUser); - m_pIMAPMod->CacheLogin(CString(m_spAuth->GetUsername() + ":" + m_spAuth->GetPassword()).MD5()); // Use MD5 so passes don't sit in memory in plain text + m_pIMAPMod->CacheLogin(CString(m_spAuth->GetUsername() + ":" + m_spAuth->GetPassword()).MD5()); // Use MD5 so passes don't sit in memory in plain text DEBUG("+++ Successful IMAP lookup"); } else { m_spAuth->RefuseLogin("Invalid Password"); diff --git a/modules/extra/modtcl.cpp b/modules/extra/modtcl.cpp index cf5e81b8..12afc4b6 100644 --- a/modules/extra/modtcl.cpp +++ b/modules/extra/modtcl.cpp @@ -17,12 +17,12 @@ #define STDVAR (ClientData cd, Tcl_Interp *irp, int argc, const char *argv[]) -#define BADARGS(nl, nh, example) do { \ - if ((argc < (nl)) || (argc > (nh))) { \ - Tcl_AppendResult(irp, "wrong # args: should be \"", \ - argv[0], (example), "\"", NULL); \ - return TCL_ERROR; \ - } \ +#define BADARGS(nl, nh, example) do { \ + if ((argc < (nl)) || (argc > (nh))) { \ + Tcl_AppendResult(irp, "wrong # args: should be \"", \ + argv[0], (example), "\"", NULL); \ + return TCL_ERROR; \ + } \ } while (0) class CModTcl; @@ -34,7 +34,7 @@ public: virtual ~CModTclTimer() {} protected: virtual void RunJob(); - CModTcl* m_pParent; + CModTcl* m_pParent; }; class CModTclStartTimer : public CTimer { @@ -44,7 +44,7 @@ public: virtual ~CModTclStartTimer() {} protected: virtual void RunJob(); - CModTcl* m_pParent; + CModTcl* m_pParent; }; diff --git a/modules/extra/saslauth.cpp b/modules/extra/saslauth.cpp index 3676fd23..62a7627b 100644 --- a/modules/extra/saslauth.cpp +++ b/modules/extra/saslauth.cpp @@ -61,7 +61,7 @@ public: CUser* pUser(CZNC::Get().FindUser(user)); sasl_conn_t *sasl_conn(0); - if (!pUser) { // @todo Will want to do some sort of && !m_bAllowCreate in the future + if (!pUser) { // @todo Will want to do some sort of && !m_bAllowCreate in the future Auth->RefuseLogin("Invalid User - Halting SASL Authentication"); return HALT; } @@ -87,10 +87,10 @@ public: } private: - TCacheMap m_Cache; + TCacheMap m_Cache; - static sasl_callback_t cbs[]; - static CString method; + static sasl_callback_t cbs[]; + static CString method; static int getopt(void *context, const char *plugin_name, const char *option, const char **result, unsigned *len) { if (!method.empty() && strcmp(option, "pwcheck_method") == 0) { diff --git a/modules/extra/shell.cpp b/modules/extra/shell.cpp index 017d91af..2c5d53b2 100644 --- a/modules/extra/shell.cpp +++ b/modules/extra/shell.cpp @@ -35,10 +35,10 @@ public: virtual void ReadLine(const CString& sData); virtual void Disconnected(); - CShellMod* m_pParent; + CShellMod* m_pParent; private: - CClient* m_pClient; + CClient* m_pClient; }; class CShellMod : public CModule { @@ -158,7 +158,7 @@ public: m_pManager->AddSock(new CShellSock(this, m_pClient, "cd " + m_sPath + " && " + sCommand), "SHELL"); } private: - CString m_sPath; + CString m_sPath; }; void CShellSock::ReadLine(const CString& sData) { diff --git a/modules/fail2ban.cpp b/modules/fail2ban.cpp index 6ee9b7f9..42d5e874 100644 --- a/modules/fail2ban.cpp +++ b/modules/fail2ban.cpp @@ -91,8 +91,8 @@ public: } private: - TCacheMap m_Cache; - unsigned int m_uiAllowedFailed; + TCacheMap m_Cache; + unsigned int m_uiAllowedFailed; }; GLOBALMODULEDEFS(CFailToBanMod, "Block IPs for some time after a failed login") diff --git a/modules/keepnick.cpp b/modules/keepnick.cpp index 047cb4cd..74101b29 100644 --- a/modules/keepnick.cpp +++ b/modules/keepnick.cpp @@ -20,7 +20,7 @@ public: void RunJob(); private: - CKeepNickMod* m_pMod; + CKeepNickMod* m_pMod; }; class CKeepNickMod : public CModule { @@ -180,7 +180,7 @@ public: private: // If this is NULL, we are turned off for some reason - CKeepNickTimer* m_pTimer; + CKeepNickTimer* m_pTimer; }; CKeepNickTimer::CKeepNickTimer(CKeepNickMod *pMod) : CTimer(pMod, 30, 0, @@ -193,4 +193,3 @@ void CKeepNickTimer::RunJob() { } MODULEDEFS(CKeepNickMod, "Keep trying for your primary nick") - diff --git a/modules/modperl.cpp b/modules/modperl.cpp index 43c4751e..dcfce759 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -89,7 +89,7 @@ public: } private: - EType m_eType; + EType m_eType; }; @@ -163,10 +163,10 @@ public: private: - CString m_sModuleName; - CString m_sUsername; // NEED these so we can send the signal to the right guy - int m_iParentFD; - VPString m_vArgs; + CString m_sModuleName; + CString m_sUsername; // NEED these so we can send the signal to the right guy + int m_iParentFD; + VPString m_vArgs; void SetupArgs() { @@ -198,9 +198,9 @@ public: protected: virtual void RunJob(); - CString m_sFuncName; - CString m_sUserName; - CString m_sModuleName; + CString m_sFuncName; + CString m_sUserName; + CString m_sModuleName; }; class CModPerl : public CGlobalModule @@ -424,10 +424,10 @@ public: enum ECBTYPES { - CB_LOCAL = 1, - CB_ONHOOK = 2, - CB_TIMER = 3, - CB_SOCK = 4 + CB_LOCAL = 1, + CB_ONHOOK = 2, + CB_TIMER = 3, + CB_SOCK = 4 }; EModRet CallBack(const PString & sHookName, const VPString & vsArgs, @@ -503,7 +503,7 @@ public: void UnloadPerlMod(const CString & sModule); private: - PerlInterpreter *m_pPerl; + PerlInterpreter *m_pPerl; }; diff --git a/modules/nickserv.cpp b/modules/nickserv.cpp index 4bc86d2f..5514fc55 100644 --- a/modules/nickserv.cpp +++ b/modules/nickserv.cpp @@ -73,7 +73,7 @@ public: } private: - CString m_sPass; + CString m_sPass; }; MODULEDEFS(CNickServ, "Auths you with NickServ") diff --git a/modules/partyline.cpp b/modules/partyline.cpp index 703c9a55..2cd952e1 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -10,9 +10,9 @@ #include "znc.h" // If you change these and it breaks, you get to keep the pieces -#define CHAN_PREFIX_1 "~" -#define CHAN_PREFIX_1C '~' -#define CHAN_PREFIX CHAN_PREFIX_1 "#" +#define CHAN_PREFIX_1 "~" +#define CHAN_PREFIX_1C '~' +#define CHAN_PREFIX CHAN_PREFIX_1 "#" class CPartylineChannel { public: @@ -35,10 +35,10 @@ public: bool IsFixedChan(const CString& s) { return m_ssFixedNicks.find(s) != m_ssFixedNicks.end(); } protected: - CString m_sTopic; - CString m_sName; - set m_ssNicks; - set m_ssFixedNicks; + CString m_sTopic; + CString m_sName; + set m_ssNicks; + set m_ssFixedNicks; }; class CPartylineMod : public CGlobalModule { @@ -707,9 +707,9 @@ public: } private: - set m_ssChannels; - set m_spInjectedPrefixes; - set m_ssDefaultChans; + set m_ssChannels; + set m_spInjectedPrefixes; + set m_ssDefaultChans; }; GLOBALMODULEDEFS(CPartylineMod, "Internal channels and queries for users connected to znc") diff --git a/modules/perform.cpp b/modules/perform.cpp index c0864aff..67c226df 100644 --- a/modules/perform.cpp +++ b/modules/perform.cpp @@ -106,7 +106,7 @@ private: return true; } - VCString m_vPerform; + VCString m_vPerform; }; MODULEDEFS(CPerform, "Adds perform capabilities") diff --git a/modules/q.cpp b/modules/q.cpp index b9cf14e2..95f6967e 100644 --- a/modules/q.cpp +++ b/modules/q.cpp @@ -451,11 +451,11 @@ private: } /* Settings */ - CString m_sUsername; + CString m_sUsername; CString m_sPassword; - bool m_bUseCloakedHost; - bool m_bUseChallenge; - bool m_bRequestPerms; + bool m_bUseCloakedHost; + bool m_bUseChallenge; + bool m_bRequestPerms; void SetUsername(const CString& sUsername) { m_sUsername = sUsername; diff --git a/modules/route_replies.cpp b/modules/route_replies.cpp index 772196f3..49da81c2 100644 --- a/modules/route_replies.cpp +++ b/modules/route_replies.cpp @@ -360,11 +360,11 @@ private: } } - CClient *m_pDoing; - const struct reply *m_pReplies; - requestQueue m_vsPending; + CClient *m_pDoing; + const struct reply *m_pReplies; + requestQueue m_vsPending; // This field is only used for display purpose. - CString m_sLastRequest; + CString m_sLastRequest; }; void CRouteTimeout::RunJob() diff --git a/modules/sample.cpp b/modules/sample.cpp index 78ac27d5..9c2bdaa2 100644 --- a/modules/sample.cpp +++ b/modules/sample.cpp @@ -88,12 +88,12 @@ public: } virtual EModRet OnRaw(CString& sLine) { - // PutModule("OnRaw() [" + sLine + "]"); + // PutModule("OnRaw() [" + sLine + "]"); return CONTINUE; } virtual EModRet OnUserRaw(CString& sLine) { - // PutModule("UserRaw() [" + sLine + "]"); + // PutModule("UserRaw() [" + sLine + "]"); return CONTINUE; } diff --git a/modules/savebuff.cpp b/modules/savebuff.cpp index 1b602569..3e4d2bd8 100644 --- a/modules/savebuff.cpp +++ b/modules/savebuff.cpp @@ -294,9 +294,9 @@ public: #endif /* LEGACY_SAVEBUFF */ private: - bool m_bBootError; - bool m_bFirstLoad; - CString m_sPassword; + bool m_bBootError; + bool m_bFirstLoad; + CString m_sPassword; bool DecryptChannel(const CString & sChan, CString & sBuffer) { CString sChannel = GetPath(sChan); diff --git a/modules/schat.cpp b/modules/schat.cpp index fa09a9ac..2fc484a3 100644 --- a/modules/schat.cpp +++ b/modules/schat.cpp @@ -35,7 +35,7 @@ public: protected: virtual void RunJob(); - CString m_sNick; + CString m_sNick; }; class CSChatSock : public CSocket @@ -54,7 +54,7 @@ public: virtual bool ConnectionFrom(const CS_STRING & sHost, u_short iPort) { - Close(); // close the listener after the first connection + Close(); // close the listener after the first connection return(true); } @@ -92,9 +92,9 @@ public: } private: - CSChat *m_pModule; - CString m_sChatNick; - vector m_vBuffer; + CSChat *m_pModule; + CString m_sChatNick; + VCString m_vBuffer; }; class CSChat : public CModule @@ -393,8 +393,8 @@ public: } private: - map< CString,pair< u_long,u_short > > m_siiWaitingChats; - CString m_sPemFile; + map< CString,pair< u_long,u_short > > m_siiWaitingChats; + CString m_sPemFile; }; diff --git a/modules/watch.cpp b/modules/watch.cpp index 9629499c..9d8e2541 100644 --- a/modules/watch.cpp +++ b/modules/watch.cpp @@ -29,8 +29,8 @@ public: // !Setters private: protected: - bool m_bNegated; - CString m_sSource; + bool m_bNegated; + CString m_sSource; }; class CWatchEntry { @@ -147,11 +147,11 @@ public: // !Setters private: protected: - CString m_sHostMask; - CString m_sTarget; - CString m_sPattern; - bool m_bDisabled; - vector m_vsSources; + CString m_sHostMask; + CString m_sTarget; + CString m_sPattern; + bool m_bDisabled; + vector m_vsSources; }; class CWatcherMod : public CModule { @@ -312,7 +312,7 @@ private: return; } - uIdx--; // "convert" index to zero based + uIdx--; // "convert" index to zero based if (uIdx >= m_lsWatchers.size()) { PutModule("Invalid Id"); return; @@ -388,7 +388,7 @@ private: } void SetSources(unsigned int uIdx, const CString& sSources) { - uIdx--; // "convert" index to zero based + uIdx--; // "convert" index to zero based if (uIdx >= m_lsWatchers.size()) { PutModule("Invalid Id"); return; @@ -404,7 +404,7 @@ private: } void Remove(unsigned int uIdx) { - uIdx--; // "convert" index to zero based + uIdx--; // "convert" index to zero based if (uIdx >= m_lsWatchers.size()) { PutModule("Invalid Id"); return; @@ -549,8 +549,8 @@ private: PutModule("WARNING: malformed entry found while loading"); } - list m_lsWatchers; - CBuffer m_Buffer; + list m_lsWatchers; + CBuffer m_Buffer; }; MODULEDEFS(CWatcherMod, "Copy activity from a specific user into a separate window") diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index 5a36eef0..a7f47f10 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -965,7 +965,7 @@ public: } private: - map m_suSwitchCounters; + map m_suSwitchCounters; }; GLOBALMODULEDEFS(CWebAdminMod, "Web based administration module") diff --git a/znc.cpp b/znc.cpp index 36a4de86..8903f17a 100644 --- a/znc.cpp +++ b/znc.cpp @@ -1087,12 +1087,12 @@ bool CZNC::DoRehash(CString& sError) } CString sLine; - bool bCommented = false; // support for /**/ style comments - CUser* pUser = NULL; // Used to keep track of which user block we are in - CUser* pRealUser = NULL; // If we rehash a user, this is the real one - CChan* pChan = NULL; // Used to keep track of which chan block we are in + bool bCommented = false; // support for /**/ style comments + CUser* pUser = NULL; // Used to keep track of which user block we are in + CUser* pRealUser = NULL; // If we rehash a user, this is the real one + CChan* pChan = NULL; // Used to keep track of which chan block we are in unsigned int uLineNum = 0; - MCString msModules; // Modules are queued for later loading + MCString msModules; // Modules are queued for later loading std::list lGlobalModuleConfigLine;