public:
CommandCBan(Module* Creator) : Command(Creator, "CBAN", 1, 3)
{
- flags_needed = 'o'; this->syntax = "<channel> [<duration> :<reason>]";
+ flags_needed = 'o'; this->syntax = "<channel> [<duration> [:<reason>]]";
}
CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
if (parameters.size() == 1)
{
- if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "CBAN", user))
+ std::string reason;
+
+ if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "CBAN", reason, user))
{
- ServerInstance->SNO->WriteGlobalSno('x', "%s removed CBan on %s.",user->nick.c_str(),parameters[0].c_str());
+ ServerInstance->SNO->WriteGlobalSno('x', "%s removed CBan on %s: %s", user->nick.c_str(), parameters[0].c_str(), reason.c_str());
}
else
{
}
else
{
- time_t c_requires_crap = duration + ServerInstance->Time();
- std::string timestr = InspIRCd::TimeString(c_requires_crap);
- ServerInstance->SNO->WriteGlobalSno('x', "%s added timed CBan for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), timestr.c_str(), reason);
+ ServerInstance->SNO->WriteGlobalSno('x', "%s added timed CBan for %s, expires in %s (on %s): %s",
+ user->nick.c_str(), parameters[0].c_str(), InspIRCd::DurationString(duration).c_str(),
+ InspIRCd::TimeString(ServerInstance->Time() + duration).c_str(), reason);
}
}
else