]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_eline.cpp
Add -Wshadow to cflags, and fix a bunch of warnings that come with it. Add a note...
[user/henk/code/inspircd.git] / src / commands / cmd_eline.cpp
index 83c921d8bc3e0cbedb3b4e9ffaaa0a77198529ca..ca95955b7a4d1bb92b82e746b31f53be9123ee0f 100644 (file)
@@ -2,11 +2,11 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ *         the file COPYING for details.
  *
  * ---------------------------------------------------
  */
@@ -26,15 +26,20 @@ CmdResult CommandEline::Handle (const char** parameters, int pcnt, User *user)
 {
        if (pcnt >= 3)
        {
-               IdentHostPair ih = ServerInstance->XLines->IdentSplit(parameters[0]);
-               if (ServerInstance->HostMatchesEveryone(ih.first+"@"+ih.second,user))
-                       return CMD_FAILURE;
-
-               if (!strchr(parameters[0],'@'))
+               IdentHostPair ih;
+               User* find = ServerInstance->FindNick(parameters[0]);
+               if (find)
                {
-                       user->WriteServ("NOTICE %s :*** E-Line must contain a username, e.g. *@%s",user->nick,parameters[0]);
-                       return CMD_FAILURE;
+                       ih.first = "*";
+                       ih.second = find->GetIPString();
+                       std::string c = std::string("*@") + find->GetIPString();
+                       parameters[0] = c.c_str();
                }
+               else
+                       ih = ServerInstance->XLines->IdentSplit(parameters[0]);
+
+               if (ServerInstance->HostMatchesEveryone(ih.first+"@"+ih.second,user))
+                       return CMD_FAILURE;
 
                long duration = ServerInstance->Duration(parameters[1]);