]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_showwhois.cpp
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / src / modules / m_showwhois.cpp
index ba4ba9e6ee04a69b04889f6421a1a96c3e68d64e..459e4866458f8690e2a500755f527c38510a3367 100644 (file)
@@ -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));
        }
@@ -109,7 +108,7 @@ class ModuleShowwhois : public Module
                if (!dest->IsModeSet('W') || source == dest)
                        return;
 
-               if (!ShowWhoisFromOpers && IS_OPER(source))
+               if (!ShowWhoisFromOpers && source->IsOper())
                        return;
 
                if (IS_LOCAL(dest))
@@ -126,7 +125,7 @@ class ModuleShowwhois : public Module
                        ServerInstance->PI->SendEncapsulatedData(params);
                }
        }
-
 };
 
 MODULE_INIT(ModuleShowwhois)
+