summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-04-18 16:49:38 +0100
committerSadie Powell <sadie@witchery.services>2021-04-18 16:49:38 +0100
commit6b188f1d4ebd00c1e93a0a4ac68af04de0bbaeab (patch)
tree1714bdc8f1119583d3e72b47e5ed4335bb720232
parent01884cb328a677fb8e75807da52b2fd9a96b2225 (diff)
Use a duration string for the idle time in `/STATS P`.
-rw-r--r--src/coremods/core_stats.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp
index 19e429a95..6ce733db7 100644
--- a/src/coremods/core_stats.cpp
+++ b/src/coremods/core_stats.cpp
@@ -196,8 +196,9 @@ void CommandStats::DoStats(Stats::Context& stats)
if (!oper->server->IsULine())
{
LocalUser* lu = IS_LOCAL(oper);
- stats.AddRow(249, oper->nick + " (" + oper->ident + "@" + oper->GetDisplayedHost() + ") Idle: " +
- (lu ? ConvToStr(ServerInstance->Time() - lu->idle_lastmsg) + " secs" : "unavailable"));
+ const std::string idle = lu ? InspIRCd::DurationString(ServerInstance->Time() - lu->idle_lastmsg) : "unavailable";
+ stats.AddRow(249, InspIRCd::Format("%s (%s@%s) Idle: %s", oper->nick.c_str(),
+ oper->ident.c_str(), oper->GetDisplayedHost().c_str(), idle.c_str()));
idx++;
}
}