summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-11-23 12:52:03 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-11-23 12:52:03 +0100
commitf3667d995e439a1d75fd9b56b29b610f3d877d8b (patch)
treee2f486a99bee4547b999714ad579adc72619f547 /src
parent6fc00fa62905e5990fa9667f540e10a775832540 (diff)
Implement ExtensionItem::RegisterService()
Diffstat (limited to 'src')
-rw-r--r--src/base.cpp6
-rw-r--r--src/modules.cpp4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/base.cpp b/src/base.cpp
index 63b14256e..4111451f8 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -144,6 +144,12 @@ void* ExtensionItem::unset_raw(Extensible* container)
return rv;
}
+void ExtensionItem::RegisterService()
+{
+ if (!ServerInstance->Extensions.Register(this))
+ throw ModuleException("Extension already exists: " + name);
+}
+
bool ExtensionManager::Register(ExtensionItem* item)
{
return types.insert(std::make_pair(item->name, item)).second;
diff --git a/src/modules.cpp b/src/modules.cpp
index f5998f79c..ca13dad73 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -556,10 +556,6 @@ void ModuleManager::AddService(ServiceProvider& item)
{
switch (item.service)
{
- case SERVICE_METADATA:
- if (!ServerInstance->Extensions.Register(static_cast<ExtensionItem*>(&item)))
- throw ModuleException("Extension " + std::string(item.name) + " already exists.");
- return;
case SERVICE_DATA:
case SERVICE_IOHOOK:
{