]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sanick.cpp
Untested! New m_watch that should be hundreds of times faster (im not joking either)
[user/henk/code/inspircd.git] / src / modules / m_sanick.cpp
index 0ce9338a43f4feff165e23a64416d80b37064536..e337ed6300466beef173ab4c78f1a90306894a87 100644 (file)
@@ -25,9 +25,8 @@ using namespace std;
 
 /* $ModDesc: Provides support for SANICK command */
 
-
-
-
+/** Handle /SANICK
+ */
 class cmd_sanick : public command_t
 {
  public:
@@ -47,17 +46,18 @@ class cmd_sanick : public command_t
                                user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
                                return CMD_FAILURE;
                        }
+                       std::string oldnick = user->nick;
                        if (ServerInstance->IsNick(parameters[1]))
                        {
                                if (source->ForceNickChange(parameters[1]))
                                {
-                                       ServerInstance->WriteOpers(std::string(user->nick)+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]);
+                                       ServerInstance->WriteOpers(oldnick+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]);
                                        return CMD_SUCCESS;
                                }
                                else
                                {
                                        /* We couldnt change the nick */
-                                       ServerInstance->WriteOpers(std::string(user->nick)+" failed SANICK (from "+std::string(parameters[0])+" to "+parameters[1]+")");
+                                       ServerInstance->WriteOpers(oldnick+" failed SANICK (from "+std::string(parameters[0])+" to "+parameters[1]+")");
                                        return CMD_FAILURE;
                                }
                        }
@@ -68,6 +68,10 @@ class cmd_sanick : public command_t
 
                        return CMD_FAILURE;
                }
+               else
+               {
+                       user->WriteServ("NOTICE %s :*** No such nickname: '%s'", user->nick, parameters[0]);
+               }
 
                return CMD_FAILURE;
        }
@@ -92,7 +96,7 @@ class ModuleSanick : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,1,VF_VENDOR);
+               return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
        
 };