]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nicklock.cpp
Change 974 numeric to 490 to avoid collision with Insp's failed to load module error
[user/henk/code/inspircd.git] / src / modules / m_nicklock.cpp
index 37e9d49bdb325312325f389555adfebd92a2d929..731704d6850c9ddeb25e46c83739dee503698a65 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
@@ -51,23 +51,13 @@ class cmd_nicklock : public command_t
                        }
                        if (Srv->IsNick(std::string(parameters[1])))
                        {
-                               server = user->server;
-                               me = Srv->GetServerName().c_str();
-       
-                               if (server == me)
-                               {
-                                       // give them a lock flag
-                                       Srv->SendOpers(std::string(user->nick)+" used NICKLOCK to change and hold "+std::string(parameters[0])+" to "+parameters[1]);
-                                       Srv->ChangeUserNick(source,std::string(parameters[1]));
-                                       // only attempt to set their lockflag after we know the change succeeded
-                                       source = Srv->FindNick(std::string(parameters[1]));
-                                       if (source)
-                                               source->Extend("nick_locked", "ON");
-                               }
-                               else
-                               {
-                                       WriteServ(user->fd,"947 %s %s :Can't lock the nickname of a non-local user",user->nick,source->nick);
-                               }
+                               // give them a lock flag
+                               Srv->SendOpers(std::string(user->nick)+" used NICKLOCK to change and hold "+std::string(parameters[0])+" to "+parameters[1]);
+                               Srv->ChangeUserNick(source,std::string(parameters[1]));
+                               // only attempt to set their lockflag after we know the change succeeded
+                               source = Srv->FindNick(std::string(parameters[1]));
+                               if (source)
+                                       source->Extend("nick_locked", "ON");
                        }
                }
        }
@@ -118,6 +108,11 @@ class ModuleNickLock : public Module
                return Version(1,0,0,1,VF_VENDOR);
        }
 
+       void Implements(char* List)
+       {
+               List[I_OnUserPreNick] = List[I_OnUserQuit] = 1;
+       }
+
        virtual int OnUserPreNick(userrec* user, std::string newnick)
        {
                if (user->GetExt("nick_locked"))