From 349106f3f9f75d7f957fc5d1e71ca650f4807bb9 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 2 Dec 2012 19:40:17 +0100 Subject: Register all commands, modes and extensions using AddService() AddService() throws an exception if an item cannot be registered, modules no longer need to worry about AddMode() etc. failing --- src/modules/m_showwhois.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/modules/m_showwhois.cpp') diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index ba4ba9e6e..434d1b07f 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -87,9 +87,8 @@ class ModuleShowwhois : public Module ShowWhoisFromOpers = tag->getBool("showfromopers", true); sw = new SeeWhois(this, OpersOnly); - if (!ServerInstance->Modes->AddMode(sw)) - throw ModuleException("Could not add new modes!"); - ServerInstance->AddCommand(&cmd); + ServerInstance->Modules->AddService(*sw); + ServerInstance->Modules->AddService(cmd); Implementation eventlist[] = { I_OnWhois }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } -- cgit v1.2.3