diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-11-23 12:52:03 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-11-23 12:52:03 +0100 |
commit | f3667d995e439a1d75fd9b56b29b610f3d877d8b (patch) | |
tree | e2f486a99bee4547b999714ad579adc72619f547 /src | |
parent | 6fc00fa62905e5990fa9667f540e10a775832540 (diff) |
Implement ExtensionItem::RegisterService()
Diffstat (limited to 'src')
-rw-r--r-- | src/base.cpp | 6 | ||||
-rw-r--r-- | src/modules.cpp | 4 |
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: { |