diff options
-rw-r--r-- | src/modules.cpp | 17 | ||||
-rw-r--r-- | src/modules/m_oper_hash.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_sha256.cpp | 2 |
3 files changed, 17 insertions, 4 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) diff --git a/src/modules/m_oper_hash.cpp b/src/modules/m_oper_hash.cpp index a83b9cc51..7f768f0e3 100644 --- a/src/modules/m_oper_hash.cpp +++ b/src/modules/m_oper_hash.cpp @@ -105,7 +105,7 @@ class ModuleOperHash : public Module { ServerInstance->Log(DEBUG, "Found interface 'HashRequest' containing %d modules", ml->size()); - for (modulelist::iterator m = ml->begin(); m != ml->end(); ml++) + for (modulelist::iterator m = ml->begin(); m != ml->end(); m++) { std::string name = HashNameRequest(this, *m).Send(); hashers[name] = *m; diff --git a/src/modules/m_sha256.cpp b/src/modules/m_sha256.cpp index 68b7ad3d9..d6378d405 100644 --- a/src/modules/m_sha256.cpp +++ b/src/modules/m_sha256.cpp @@ -279,7 +279,7 @@ class ModuleSHA256 : public Module SHA256((const char*)SHA->GetHashData(), data, strlen(SHA->GetHashData()), chars ? chars : "0123456789abcdef", key); return data; } - else if (strcmp("SUM", request->GetId()) == 0) + else if (strcmp("NAME", request->GetId()) == 0) { return "SHA256"; } |