mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Handle modules not being defined in LoadModule() and UnloadModule()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@92 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
10
Modules.cpp
10
Modules.cpp
@@ -478,6 +478,10 @@ CModule* CModules::FindModule(const string& sModule) {
|
||||
}
|
||||
|
||||
bool CModules::LoadModule(const string& sModule, const string& sArgs, CUser* pUser, string& sRetMsg) {
|
||||
#ifndef _MODULES
|
||||
sRetMsg = "Unable to load module [" + sModule + "] module support was not enabled.";
|
||||
return false;
|
||||
#else
|
||||
sRetMsg = "";
|
||||
|
||||
if (!pUser) {
|
||||
@@ -559,9 +563,14 @@ bool CModules::LoadModule(const string& sModule, const string& sArgs, CUser* pUs
|
||||
|
||||
sRetMsg = "Loaded module [" + sModule + "] [" + sModPath + "]";
|
||||
return true;
|
||||
#endif // !_MODULES
|
||||
}
|
||||
|
||||
bool CModules::UnloadModule(const string& sModule, string& sRetMsg) {
|
||||
#ifndef _MODULES
|
||||
sRetMsg = "Unable to unload module [" + sModule + "] module support was not enabled.";
|
||||
return false;
|
||||
#else
|
||||
CModule* pModule = FindModule(sModule);
|
||||
sRetMsg = "";
|
||||
|
||||
@@ -598,6 +607,7 @@ bool CModules::UnloadModule(const string& sModule, string& sRetMsg) {
|
||||
|
||||
sRetMsg = "Unable to unload module [" + sModule + "]";
|
||||
return false;
|
||||
#endif // !_MODULES
|
||||
}
|
||||
|
||||
bool CModules::ReloadModule(const string& sModule, const string& sArgs, CUser* pUser, string& sRetMsg) {
|
||||
|
||||
Reference in New Issue
Block a user