summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/modules.h2
-rw-r--r--src/modules.cpp12
2 files changed, 14 insertions, 0 deletions
diff --git a/include/modules.h b/include/modules.h
index 786275c0e..00b7ed5f7 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -1295,6 +1295,8 @@ class Server : public classbase
*/
Module* FindFeature(const std::string &FeatureName);
+ const char* GetModuleName(Module* m);
+
/** Writes a log string.
* This method writes a line of text to the log. If the level given is lower than the
* level given in the configuration, this command has no effect.
diff --git a/src/modules.cpp b/src/modules.cpp
index 2c72943ec..d6119bd5b 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -292,6 +292,18 @@ Module* Server::FindFeature(const std::string &FeatureName)
return iter->second;
}
+const char* Server::GetModuleName(Module* m)
+{
+ for (int i = 0; i <= MODCOUNT; i++)
+ {
+ if (modules[i] == m)
+ {
+ return module_names[i];
+ }
+ }
+ return "";
+}
+
void Server::RehashServer()
{
WriteOpers("*** Rehashing config file");