diff options
Diffstat (limited to 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 2b5a07296..05119f9bb 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -251,8 +251,21 @@ Module* InspIRCd::FindFeature(const std::string &FeatureName) bool InspIRCd::PublishInterface(const std::string &InterfaceName, Module* Mod) { - Interfaces[InterfaceName].push_back(Mod); - return true; + interfacelist::iterator iter = Interfaces.find(InterfaceName); + + if (iter == Interfaces.end()) + { + modulelist ml; + ml.push_back(Mod); + Interfaces[InterfaceName] = ml; + return true; + } + else + { + iter->second.push_back(Mod); + return true; + } + return false; } bool InspIRCd::UnpublishInterface(const std::string &InterfaceName, Module* Mod) |