mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-12 12:09:03 -04:00
Ignore <module> tags for modules that are already loaded.
This allows us to do user friendly things like loading the alias module in the example alias files.
This commit is contained in:
parent
aac644de3d
commit
3b927b48cc
@ -1,6 +1,8 @@
|
||||
# This file contains aliases and nickname reservations which are used
|
||||
# by all common services implementations.
|
||||
|
||||
<module name="alias">
|
||||
|
||||
# Long hand aliases for services pseudoclients.
|
||||
<alias text="BOTSERV" replace="PRIVMSG $requirement :$2-" requires="BotServ" uline="yes">
|
||||
<alias text="CHANSERV" replace="PRIVMSG $requirement :$2-" requires="ChanServ" uline="yes">
|
||||
|
@ -726,6 +726,10 @@ void ServerConfig::ApplyModules(User* user)
|
||||
|
||||
for (std::vector<std::string>::iterator adding = added_modules.begin(); adding != added_modules.end(); adding++)
|
||||
{
|
||||
// Skip modules which are already loaded.
|
||||
if (ServerInstance->Modules->Find(*adding))
|
||||
continue;
|
||||
|
||||
if (ServerInstance->Modules->Load(*adding))
|
||||
{
|
||||
ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH LOADED MODULE: %s",adding->c_str());
|
||||
|
@ -468,10 +468,14 @@ void ModuleManager::LoadAll()
|
||||
for (ConfigIter i = tags.first; i != tags.second; ++i)
|
||||
{
|
||||
ConfigTag* tag = i->second;
|
||||
std::string name = tag->getString("name");
|
||||
this->NewServices = &servicemap[ExpandModName(name)];
|
||||
std::cout << "[" << con_green << "*" << con_reset << "] Loading module:\t" << con_green << name << con_reset << std::endl;
|
||||
std::string name = ExpandModName(tag->getString("name"));
|
||||
this->NewServices = &servicemap[name];
|
||||
|
||||
// Skip modules which are already loaded.
|
||||
if (Modules.find(name) != Modules.end())
|
||||
continue;
|
||||
|
||||
std::cout << "[" << con_green << "*" << con_reset << "] Loading module:\t" << con_green << name << con_reset << std::endl;
|
||||
if (!this->Load(name, true))
|
||||
{
|
||||
ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, this->LastError());
|
||||
|
Loading…
x
Reference in New Issue
Block a user