From f3667d995e439a1d75fd9b56b29b610f3d877d8b Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 23 Nov 2015 12:52:03 +0100 Subject: Implement ExtensionItem::RegisterService() --- src/base.cpp | 6 ++++++ src/modules.cpp | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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(&item))) - throw ModuleException("Extension " + std::string(item.name) + " already exists."); - return; case SERVICE_DATA: case SERVICE_IOHOOK: { -- cgit v1.2.3