Do all module calls through the macros

This commit should make sure that all module calls are done through either
MODULECALL, GLOBALMODULECALL or ALLMODULECALL. Also, in the process some module
calls where ("accidentally" ;) ) fixed to set correct values for a global
module's m_pUser during a module call.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2076 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-07-08 16:43:23 +00:00
parent 94ea2c6c42
commit 9ae959b800
5 changed files with 34 additions and 47 deletions
+10 -6
View File
@@ -529,7 +529,7 @@ bool CModules::OnBoot() {
for (unsigned int a = 0; a < size(); a++) {
try {
if (!(*this)[a]->OnBoot()) {
return false;
return true;
}
} catch (CModule::EModException e) {
if (e == CModule::UNLOAD) {
@@ -538,7 +538,7 @@ bool CModules::OnBoot() {
}
}
return true;
return false;
}
bool CModules::OnPreRehash() { MODUNLOADCHK(OnPreRehash()); return false; }
@@ -614,24 +614,27 @@ bool CGlobalModules::OnDeleteUser(CUser& User) {
GLOBALMODHALTCHK(OnDeleteUser(User));
}
void CGlobalModules::OnClientConnect(CZNCSock* pClient, const CString& sHost, unsigned short uPort) {
bool CGlobalModules::OnClientConnect(CZNCSock* pClient, const CString& sHost, unsigned short uPort) {
GLOBALMODCALL(OnClientConnect(pClient, sHost, uPort));
return false;
}
bool CGlobalModules::OnLoginAttempt(CSmartPtr<CAuthBase> Auth) {
GLOBALMODHALTCHK(OnLoginAttempt(Auth));
}
void CGlobalModules::OnFailedLogin(const CString& sUsername, const CString& sRemoteIP) {
bool CGlobalModules::OnFailedLogin(const CString& sUsername, const CString& sRemoteIP) {
GLOBALMODCALL(OnFailedLogin(sUsername, sRemoteIP));
return false;
}
bool CGlobalModules::OnUnknownUserRaw(CClient* pClient, CString& sLine) {
GLOBALMODHALTCHK(OnUnknownUserRaw(pClient, sLine));
}
void CGlobalModules::OnClientCapLs(SCString& ssCaps) {
bool CGlobalModules::OnClientCapLs(SCString& ssCaps) {
GLOBALMODCALL(OnClientCapLs(ssCaps));
return false;
}
// Maybe create new macro for this?
@@ -661,8 +664,9 @@ bool CGlobalModules::IsClientCapSupported(const CString& sCap, bool bState) {
return bResult;
}
void CGlobalModules::OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState) {
bool CGlobalModules::OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState) {
GLOBALMODCALL(OnClientCapRequest(pClient, sCap, bState));
return false;
}