]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_mode.cpp
Fix a couple of issues
[user/henk/code/inspircd.git] / src / commands / cmd_mode.cpp
index 88c09c889e795210cbd25316b53beb42afb7052e..1a42835e501ccd6929d9b72ed427017ce62f312c 100644 (file)
@@ -1,16 +1,23 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
  *
- * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ * This file is part of InspIRCd.  InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
  *
- * ---------------------------------------------------
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #include "inspircd.h"
 
 /** Handle /MODE. These command handlers can be reloaded by the core,
@@ -31,6 +38,10 @@ class CommandMode : public Command
         * @return A value from CmdResult to indicate command success or failure.
         */
        CmdResult Handle(const std::vector<std::string>& parameters, User *user);
+       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+       {
+               return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
+       }
 };
 
 
@@ -38,7 +49,7 @@ class CommandMode : public Command
  */
 CmdResult CommandMode::Handle (const std::vector<std::string>& parameters, User *user)
 {
-       ServerInstance->Modes->Process(parameters, user, false);
+       ServerInstance->Modes->Process(parameters, user, (IS_LOCAL(user) ? ModeParser::MODE_NONE : ModeParser::MODE_LOCALONLY));
        return CMD_SUCCESS;
 }