]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sanick.cpp
Fix test client error cheecking on result types
[user/henk/code/inspircd.git] / src / modules / m_sanick.cpp
index 618b3226b56df91a245f87bcef2e281c28928695..6c07d08cec55140a43826fb04f23ab08c29beeac 100644 (file)
@@ -3,13 +3,13 @@
  *       +------------------------------------+
  *
  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *               <Craig@chatspike.net>
+ *                    E-mail:
+ *             <brain@chatspike.net>
+ *               <Craig@chatspike.net>
  *     
  * Written by Craig Edwards, Craig McLure, and others.
  * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ *         the file COPYING for details.
  *
  * ---------------------------------------------------
  */
@@ -24,7 +24,7 @@ using namespace std;
 
 /* $ModDesc: Provides support for SANICK command */
 
-Server *Srv;
+static Server *Srv;
 
 class cmd_sanick : public command_t
 {
@@ -34,11 +34,16 @@ class cmd_sanick : public command_t
                this->source = "m_sanick.so";
        }
 
-       void Handle (char **parameters, int pcnt, userrec *user)
+       void Handle (const char** parameters, int pcnt, userrec *user)
        {
                userrec* source = Srv->FindNick(std::string(parameters[0]));
                if (source)
                {
+                       if (Srv->IsUlined(source->server))
+                       {
+                               WriteServ(user->fd,"990 %s :Cannot use an SA command on a u-lined client",user->nick);
+                               return;
+                       }
                        if (Srv->IsNick(std::string(parameters[1])))
                        {
                                // FIX by brain: Cant use source->nick here because if it traverses a server link then