summaryrefslogtreecommitdiff
path: root/src/coremods
diff options
context:
space:
mode:
authorMatt Schatz <genius3000@g3k.solutions>2019-02-17 02:23:32 -0700
committerPeter Powell <petpow@saberuk.com>2019-02-18 09:17:38 +0000
commit755a32c75101c4df0e5699db558785fc0dbc1973 (patch)
treea5e789f122881bf1ed7dc124da779600bb3fe13c /src/coremods
parentff7bebe90c6b348b0df28864e4954d04bd17256b (diff)
Start using DurationString() in X-line additions and
a few other modules where it fits better than just showing seconds.
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_xline/cmd_eline.cpp9
-rw-r--r--src/coremods/core_xline/cmd_gline.cpp9
-rw-r--r--src/coremods/core_xline/cmd_kline.cpp9
-rw-r--r--src/coremods/core_xline/cmd_qline.cpp9
-rw-r--r--src/coremods/core_xline/cmd_zline.cpp9
5 files changed, 20 insertions, 25 deletions
diff --git a/src/coremods/core_xline/cmd_eline.cpp b/src/coremods/core_xline/cmd_eline.cpp
index 99794be3e..4a56ba7ea 100644
--- a/src/coremods/core_xline/cmd_eline.cpp
+++ b/src/coremods/core_xline/cmd_eline.cpp
@@ -69,14 +69,13 @@ CmdResult CommandEline::Handle(User* user, const Params& parameters)
{
if (!duration)
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent E-line for %s: %s", user->nick.c_str(), target.c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added permanent E-line for %s: %s", user->nick.c_str(), target.c_str(), parameters[2].c_str());
}
else
{
- time_t c_requires_crap = duration + ServerInstance->Time();
- std::string timestr = InspIRCd::TimeString(c_requires_crap);
- ServerInstance->SNO->WriteToSnoMask('x',"%s added timed E-line for %s, expires on %s: %s",user->nick.c_str(),target.c_str(),
- timestr.c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added timed E-line for %s, expires in %s (on %s): %s",
+ user->nick.c_str(), target.c_str(), InspIRCd::DurationString(duration).c_str(),
+ InspIRCd::TimeString(ServerInstance->Time() + duration).c_str(), parameters[2].c_str());
}
}
else
diff --git a/src/coremods/core_xline/cmd_gline.cpp b/src/coremods/core_xline/cmd_gline.cpp
index ae1ea5d6e..3e710978d 100644
--- a/src/coremods/core_xline/cmd_gline.cpp
+++ b/src/coremods/core_xline/cmd_gline.cpp
@@ -75,14 +75,13 @@ CmdResult CommandGline::Handle(User* user, const Params& parameters)
{
if (!duration)
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent G-line for %s: %s",user->nick.c_str(),target.c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added permanent G-line for %s: %s", user->nick.c_str(), target.c_str(), parameters[2].c_str());
}
else
{
- time_t c_requires_crap = duration + ServerInstance->Time();
- std::string timestr = InspIRCd::TimeString(c_requires_crap);
- ServerInstance->SNO->WriteToSnoMask('x',"%s added timed G-line for %s, expires on %s: %s",user->nick.c_str(),target.c_str(),
- timestr.c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added timed G-line for %s, expires in %s (on %s): %s",
+ user->nick.c_str(), target.c_str(), InspIRCd::DurationString(duration).c_str(),
+ InspIRCd::TimeString(ServerInstance->Time() + duration).c_str(), parameters[2].c_str());
}
ServerInstance->XLines->ApplyLines();
diff --git a/src/coremods/core_xline/cmd_kline.cpp b/src/coremods/core_xline/cmd_kline.cpp
index ad7511d56..1ec10aebb 100644
--- a/src/coremods/core_xline/cmd_kline.cpp
+++ b/src/coremods/core_xline/cmd_kline.cpp
@@ -75,14 +75,13 @@ CmdResult CommandKline::Handle(User* user, const Params& parameters)
{
if (!duration)
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent K-line for %s: %s",user->nick.c_str(),target.c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added permanent K-line for %s: %s", user->nick.c_str(), target.c_str(), parameters[2].c_str());
}
else
{
- time_t c_requires_crap = duration + ServerInstance->Time();
- std::string timestr = InspIRCd::TimeString(c_requires_crap);
- ServerInstance->SNO->WriteToSnoMask('x',"%s added timed K-line for %s, expires on %s: %s",user->nick.c_str(),target.c_str(),
- timestr.c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added timed K-line for %s, expires in %s (on %s): %s",
+ user->nick.c_str(), target.c_str(), InspIRCd::DurationString(duration).c_str(),
+ InspIRCd::TimeString(ServerInstance->Time() + duration).c_str(), parameters[2].c_str());
}
ServerInstance->XLines->ApplyLines();
diff --git a/src/coremods/core_xline/cmd_qline.cpp b/src/coremods/core_xline/cmd_qline.cpp
index 51f5bec16..afdc0431e 100644
--- a/src/coremods/core_xline/cmd_qline.cpp
+++ b/src/coremods/core_xline/cmd_qline.cpp
@@ -55,14 +55,13 @@ CmdResult CommandQline::Handle(User* user, const Params& parameters)
{
if (!duration)
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent Q-line for %s: %s",user->nick.c_str(), parameters[0].c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added permanent Q-line for %s: %s", user->nick.c_str(), parameters[0].c_str(), parameters[2].c_str());
}
else
{
- time_t c_requires_crap = duration + ServerInstance->Time();
- std::string timestr = InspIRCd::TimeString(c_requires_crap);
- ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Q-line for %s, expires on %s: %s",user->nick.c_str(),parameters[0].c_str(),
- timestr.c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added timed Q-line 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(), parameters[2].c_str());
}
ServerInstance->XLines->ApplyLines();
}
diff --git a/src/coremods/core_xline/cmd_zline.cpp b/src/coremods/core_xline/cmd_zline.cpp
index 4aaa3061f..d32cde295 100644
--- a/src/coremods/core_xline/cmd_zline.cpp
+++ b/src/coremods/core_xline/cmd_zline.cpp
@@ -73,14 +73,13 @@ CmdResult CommandZline::Handle(User* user, const Params& parameters)
{
if (!duration)
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent Z-line for %s: %s", user->nick.c_str(), ipaddr, parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added permanent Z-line for %s: %s", user->nick.c_str(), ipaddr, parameters[2].c_str());
}
else
{
- time_t c_requires_crap = duration + ServerInstance->Time();
- std::string timestr = InspIRCd::TimeString(c_requires_crap);
- ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Z-line for %s, expires on %s: %s",user->nick.c_str(),ipaddr,
- timestr.c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added timed Z-line for %s, expires in %s (on %s): %s",
+ user->nick.c_str(), ipaddr, InspIRCd::DurationString(duration).c_str(),
+ InspIRCd::TimeString(ServerInstance->Time() + duration).c_str(), parameters[2].c_str());
}
ServerInstance->XLines->ApplyLines();
}