summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 24b3e1945..b2fdc512d 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -60,6 +60,7 @@ extern command_table cmdlist;
class Server;
ExtModeList EMode;
+featurelist Features;
// returns true if an extended mode character is in use
bool ModeDefined(char modechar, int type)
@@ -350,6 +351,36 @@ long Server::PriorityBefore(const std::string &modulename)
return PRIORITY_DONTCARE;
}
+bool Server::PublishFeature(std::string FeatureName, Module* Mod)
+{
+ if (Features.find(FeatureName) == Features.end())
+ {
+ Features[FeatureName] = Mod;
+ return true;
+ }
+ return false;
+}
+
+bool Server::UnpublishFeature(std::string FeatureName)
+{
+ featurelist::iterator iter = Features.find(FeatureName);
+
+ if (iter == Features.end())
+ return false;
+
+ Features.erase(iter);
+}
+
+Module* Server::FindFeature(std::string FeatureName)
+{
+ featurelist::iterator iter = Features.find(FeatureName);
+
+ if (iter == Features.end())
+ return NULL;
+
+ return iter->second;
+}
+
void Server::RehashServer()
{
WriteOpers("*** Rehashing config file");