/** Handle /ELINE
*/
-CmdResult CommandEline::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandEline::Handle(User* user, const Params& parameters)
{
std::string target = parameters[0];
if (ih.first.empty())
{
- user->WriteNotice("*** Target not found");
+ user->WriteNotice("*** Target not found.");
return CMD_FAILURE;
}
if (InsaneBan::MatchesEveryone(ih.first+"@"+ih.second, matcher, user, "E", "hostmasks"))
return CMD_FAILURE;
- unsigned long duration = InspIRCd::Duration(parameters[1]);
+ unsigned long duration;
+ if (!InspIRCd::Duration(parameters[1], duration))
+ {
+ user->WriteNotice("*** Invalid duration for E-line.");
+ return CMD_FAILURE;
+ }
ELine* el = new ELine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
if (ServerInstance->XLines->AddLine(el, user))
{
else
{
delete el;
- user->WriteNotice("*** E-Line for " + target + " already exists");
+ user->WriteNotice("*** E-line for " + target + " already exists.");
}
}
else
}
else
{
- user->WriteNotice("*** E-Line " + target + " not found in list, try /stats e");
+ user->WriteNotice("*** E-line " + target + " not found in list, try /stats e.");
}
}