]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules.cpp
m_spanningtree Add server-to-server SINFO command handler and builder
[user/henk/code/inspircd.git] / src / modules.cpp
index c27147820579c78aa459c677d35063a244de7090..2825b2d0ea3ea8105e92cc40b3be24bef655428d 100644 (file)
 
 #include <iostream>
 #include "inspircd.h"
-#include "xline.h"
-#include "socket.h"
-#include "socketengine.h"
-#include "command_parse.h"
 #include "exitcodes.h"
 
 #ifndef _WIN32
@@ -151,7 +147,7 @@ void                Module::OnBuildNeighborList(User*, IncludeChanList&, std::map<User*,bool>&
 void           Module::OnGarbageCollect() { DetachEvent(I_OnGarbageCollect); }
 ModResult      Module::OnSetConnectClass(LocalUser* user, ConnectClass* myclass) { DetachEvent(I_OnSetConnectClass); return MOD_RES_PASSTHRU; }
 void           Module::OnText(User*, void*, int, const std::string&, char, CUList&) { DetachEvent(I_OnText); }
-void           Module::OnNamesListItem(User*, Membership*, std::string&, std::string&) { DetachEvent(I_OnNamesListItem); }
+ModResult      Module::OnNamesListItem(User*, Membership*, std::string&, std::string&) { DetachEvent(I_OnNamesListItem); return MOD_RES_PASSTHRU; }
 ModResult      Module::OnNumeric(User*, unsigned int, const std::string&) { DetachEvent(I_OnNumeric); return MOD_RES_PASSTHRU; }
 ModResult   Module::OnAcceptConnection(int, ListenSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) { DetachEvent(I_OnAcceptConnection); return MOD_RES_PASSTHRU; }
 void           Module::OnSendWhoLine(User*, const std::vector<std::string>&, User*, Membership*, std::string&) { DetachEvent(I_OnSendWhoLine); }
@@ -593,7 +589,7 @@ void ModuleManager::AddService(ServiceProvider& item)
        switch (item.service)
        {
                case SERVICE_COMMAND:
-                       if (!ServerInstance->Parser->AddCommand(static_cast<Command*>(&item)))
+                       if (!ServerInstance->Parser.AddCommand(static_cast<Command*>(&item)))
                                throw ModuleException("Command "+std::string(item.name)+" already exists.");
                        return;
                case SERVICE_MODE:
@@ -611,7 +607,7 @@ void ModuleManager::AddService(ServiceProvider& item)
                case SERVICE_DATA:
                case SERVICE_IOHOOK:
                {
-                       if ((item.name.substr(0, 5) == "mode/") || (item.name.substr(0, 6) == "umode/"))
+                       if ((!item.name.compare(0, 5, "mode/", 5)) || (!item.name.compare(0, 6, "umode/", 6)))
                                throw ModuleException("The \"mode/\" and the \"umode\" service name prefixes are reserved.");
 
                        DataProviders.insert(std::make_pair(item.name, &item));