1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 #include "commands/cmd_eline.h"
18 extern "C" DllExport Command* init_command(InspIRCd* Instance)
20 return new CommandEline(Instance);
25 CmdResult CommandEline::Handle (const char** parameters, int pcnt, User *user)
30 User* find = ServerInstance->FindNick(parameters[0]);
34 ih.second = find->GetIPString();
37 ih = ServerInstance->XLines->IdentSplit(parameters[0]);
39 if (ServerInstance->HostMatchesEveryone(ih.first+"@"+ih.second,user))
42 long duration = ServerInstance->Duration(parameters[1]);
44 ELine* el = new ELine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], ih.first.c_str(), ih.second.c_str());
45 if (ServerInstance->XLines->AddLine(el, user))
49 ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent E-line for %s.",user->nick,parameters[0]);
53 time_t c_requires_crap = duration + ServerInstance->Time();
54 ServerInstance->SNO->WriteToSnoMask('x',"%s added timed E-line for %s, expires on %s",user->nick,parameters[0],
55 ServerInstance->TimeString(c_requires_crap).c_str());
61 user->WriteServ("NOTICE %s :*** E-Line for %s already exists",user->nick,parameters[0]);
66 if (ServerInstance->XLines->DelLine(parameters[0], "E", user))
68 ServerInstance->SNO->WriteToSnoMask('x',"%s Removed E-line on %s.",user->nick,parameters[0]);
72 user->WriteServ("NOTICE %s :*** E-Line %s not found in list, try /stats e.",user->nick,parameters[0]);