mirror of
https://github.com/znc/znc.git
synced 2026-05-09 23:04:47 +02:00
Get rid of the module questions during --makeconf
The following modules are enabled by default: - global: webadmin - user: controlpanel, chansaver - network: simple_away This reduces a lot makeconf noise and fixes #541.
This commit is contained in:
@@ -1196,6 +1196,28 @@ void CModules::GetAvailableMods(set<CModInfo>& ssMods, CModInfo::EModuleType eTy
|
||||
GLOBALMODULECALL(OnGetAvailableMods(ssMods, eType), NOTHING);
|
||||
}
|
||||
|
||||
void CModules::GetDefaultMods(set<CModInfo>& ssMods, CModInfo::EModuleType eType) {
|
||||
|
||||
GetAvailableMods(ssMods, eType);
|
||||
|
||||
const map<CString, CModInfo::EModuleType> ns = {
|
||||
{ "chansaver", CModInfo::UserModule },
|
||||
{ "controlpanel", CModInfo::UserModule },
|
||||
{ "simple_away", CModInfo::NetworkModule },
|
||||
{ "webadmin", CModInfo::GlobalModule }
|
||||
};
|
||||
|
||||
auto it = ssMods.begin();
|
||||
while (it != ssMods.end()) {
|
||||
auto it2 = ns.find(it->GetName());
|
||||
if (it2 != ns.end() && it2->second == eType) {
|
||||
++it;
|
||||
} else {
|
||||
it = ssMods.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CModules::FindModPath(const CString& sModule, CString& sModPath,
|
||||
CString& sDataPath) {
|
||||
CString sMod = sModule;
|
||||
|
||||
Reference in New Issue
Block a user