diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-30 12:21:27 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-30 12:21:27 +0000 |
commit | 8eee1026bc80751cbf86c2e0685945f6d0302fee (patch) | |
tree | 08c886f0c0884ebfaf76c55fd90145ca1e90ab2b | |
parent | ae355704b0c7e952ea920a7e48c64f2934560e90 (diff) |
Bit of a cleanup, removed some unnecessary stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2048 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_nicklock.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index e31fed675..a2d365c3a 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -27,12 +27,13 @@ using namespace std; /* $ModDesc: Provides the NICKLOCK command, allows an oper to chage a users nick and lock them to it until they quit */ Server *Srv; - -char* dummy = "ON"; void handle_nicklock(char **parameters, int pcnt, userrec *user) { userrec* source = Srv->FindNick(std::string(parameters[0])); + irc::string server; + irc::string me; + if (source) { if (source->GetExt("nick_locked")) @@ -42,17 +43,18 @@ void handle_nicklock(char **parameters, int pcnt, userrec *user) } if (Srv->IsNick(std::string(parameters[1]))) { - irc::string server = user->server; - irc::string me = Srv->GetServerName().c_str(); + 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 - userrec* s2 = Srv->FindNick(std::string(parameters[1])); - if (s2) - s2->Extend("nick_locked",dummy); + source = Srv->FindNick(std::string(parameters[1])); + if (source) + source->Extend("nick_locked", "ON"); } else { |