]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_watch.cpp
m_callerid, m_dccallow Use OnUserPostNick hook instead of OnUserPreNick
[user/henk/code/inspircd.git] / src / modules / m_watch.cpp
index 1ac93bb007ef5b2d83f3f82097d3ed4db0e8096f..029055db4ee9cb8716f66115a32650ee80e11c49 100644 (file)
@@ -1,16 +1,25 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
+ *
+ *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2005-2008 Craig Edwards <craigedwards@brainbox.cc>
+ *   Copyright (C) 2006-2008 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
  *
- *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ * 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 free but copyrighted software; see
- *            the file COPYING for details.
+ * 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"
 
 /* $ModDesc: Provides support for the /WATCH command */
@@ -90,7 +99,7 @@
 #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED)
        typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash_compare<irc::string, std::less<irc::string> > > watchentries;
 #else
-       typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash<irc::string> > watchentries;
+       typedef nspace::hash_map<irc::string, std::deque<User*>, irc::hash> watchentries;
 #endif
 typedef std::map<irc::string, std::string> watchlist;
 
@@ -128,7 +137,10 @@ class CommandSVSWatch : public Command
 
        RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
        {
-               return ROUTE_BROADCAST;
+               User* target = ServerInstance->FindNick(parameters[0]);
+               if (target)
+                       return ROUTE_OPT_UCAST(target->server);
+               return ROUTE_LOCALONLY;
        }
 };
 
@@ -528,7 +540,7 @@ class Modulewatch : public Module
 
        virtual Version GetVersion()
        {
-               return Version("Provides support for the /WATCH command", VF_COMMON | VF_VENDOR);
+               return Version("Provides support for the /WATCH command", VF_OPTCOMMON | VF_VENDOR);
        }
 };