]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/precommand.cpp
Update Event and Request APIs
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / precommand.cpp
index beffba6e946a4095c7c9f85843c49837396547c8..c43e4e927c12566bb173dfc517a21838791887eb 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *       the file COPYING for details.
 /* $ModDesc: Provides a spanning tree server link protocol */
 
 #include "inspircd.h"
-#include "commands/cmd_whois.h"
-#include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
-#include "transport.h"
 
-#include "m_spanningtree/main.h"
-#include "m_spanningtree/utils.h"
-#include "m_spanningtree/treeserver.h"
-#include "m_spanningtree/treesocket.h"
+#include "main.h"
+#include "utils.h"
+#include "treeserver.h"
+#include "treesocket.h"
 
 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
 
-int ModuleSpanningTree::OnPreCommand(std::string &command, std::vector<std::string>& parameters, User *user, bool validated, const std::string &original_line)
+ModResult ModuleSpanningTree::OnPreCommand(std::string &command, std::vector<std::string>& parameters, User *user, bool validated, const std::string &original_line)
 {
        /* If the command doesnt appear to be valid, we dont want to mess with it. */
        if (!validated)
-               return 0;
+               return MOD_RES_PASSTHRU;
 
        if (command == "CONNECT")
        {
@@ -56,7 +52,7 @@ int ModuleSpanningTree::OnPreCommand(std::string &command, std::vector<std::stri
        }
        else if (command == "MAP")
        {
-               return this->HandleMap(parameters,user);
+               return this->HandleMap(parameters,user) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
        }
        else if ((command == "TIME") && (parameters.size() > 0))
        {
@@ -65,12 +61,12 @@ int ModuleSpanningTree::OnPreCommand(std::string &command, std::vector<std::stri
        else if (command == "LUSERS")
        {
                this->HandleLusers(parameters,user);
-               return 1;
+               return MOD_RES_DENY;
        }
        else if (command == "LINKS")
        {
                this->HandleLinks(parameters,user);
-               return 1;
+               return MOD_RES_DENY;
        }
        else if (command == "WHOIS")
        {
@@ -83,12 +79,8 @@ int ModuleSpanningTree::OnPreCommand(std::string &command, std::vector<std::stri
        else if ((command == "VERSION") && (parameters.size() > 0))
        {
                this->HandleVersion(parameters,user);
-               return 1;
+               return MOD_RES_DENY;
        }
-       else if ((command == "MODULES") && (parameters.size() > 0))
-       {
-               return this->HandleModules(parameters,user);
-       }
-       return 0;
+       return MOD_RES_PASSTHRU;
 }