mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Moved code for finding module path to CUser::FindModPath()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@319 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
23
Modules.cpp
23
Modules.cpp
@@ -6,10 +6,6 @@
|
||||
#include "Nick.h"
|
||||
#include "Chan.h"
|
||||
|
||||
#ifndef _MODDIR_
|
||||
#define _MODDIR_ "/usr/share/znc"
|
||||
#endif
|
||||
|
||||
#define MODUNLOADCHK(func) \
|
||||
for (unsigned int a = 0; a < size(); a++) { \
|
||||
try { \
|
||||
@@ -478,22 +474,11 @@ bool CModules::LoadModule(const CString& sModule, const CString& sArgs, CUser* p
|
||||
return false;
|
||||
}
|
||||
|
||||
CString sModPath = pUser->GetCurPath() + "/modules/" + sModule + ".so";
|
||||
CString sModPath = pUser->FindModPath(sModule);
|
||||
|
||||
if (!CFile::Exists(sModPath)) {
|
||||
DEBUG_ONLY(cout << "[" << sModPath << "] Not found..." << endl);
|
||||
sModPath = pUser->GetModPath() + "/" + sModule + ".so";
|
||||
|
||||
if (!CFile::Exists(sModPath)) {
|
||||
DEBUG_ONLY(cout << "[" << sModPath << "] Not found..." << endl);
|
||||
sModPath = _MODDIR_ + CString("/") + sModule + ".so";
|
||||
|
||||
if (!CFile::Exists(sModPath)) {
|
||||
DEBUG_ONLY(cout << "[" << sModPath << "] Not found... giving up!" << endl);
|
||||
sRetMsg = "Unable to find module [" + sModule + "]";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (sModPath.empty()) {
|
||||
sRetMsg = "Unable to find module [" + sModule + "]";
|
||||
return false;
|
||||
}
|
||||
|
||||
void* p = dlopen((sModPath).c_str(), RTLD_LAZY);
|
||||
|
||||
Reference in New Issue
Block a user