inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit 23033e286fdbc47525b21f257d4828da653b9b42
parent 095d0e615474a08455c6bc186fbdf8b1bc753e39
Author: Robby <robby@chatbelgie.be>
Date:   Sat, 27 Apr 2019 03:43:48 +0200

m_connectban and m_svshold: Use DurationString() in X-line messages.

Diffstat:
Msrc/modules/m_connectban.cpp | 5++---
Msrc/modules/m_svshold.cpp | 6+++---
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp @@ -82,9 +82,8 @@ class ModuleConnectBan : public Module } ServerInstance->XLines->ApplyLines(); std::string maskstr = mask.str(); - std::string timestr = InspIRCd::TimeString(zl->expiry); - ServerInstance->SNO->WriteGlobalSno('x',"Module m_connectban added Z-line on %s to expire on %s: Connect flooding", - maskstr.c_str(), timestr.c_str()); + ServerInstance->SNO->WriteGlobalSno('x', "Z-line added by module m_connectban on %s to expire in %s (on %s): Connect flooding", + maskstr.c_str(), InspIRCd::DurationString(zl->duration).c_str(), InspIRCd::TimeString(zl->expiry).c_str()); ServerInstance->SNO->WriteGlobalSno('a', "Connect flooding from IP range %s (%d)", maskstr.c_str(), threshold); connects.erase(i); } diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp @@ -148,9 +148,9 @@ class CommandSvshold : public Command } else { - time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = InspIRCd::TimeString(c_requires_crap); - ServerInstance->SNO->WriteGlobalSno('x', "%s added timed SVSHOLD for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), timestr.c_str(), parameters[2].c_str()); + ServerInstance->SNO->WriteGlobalSno('x', "%s added timed SVSHOLD 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()); } } else