]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Use a duration string for the idle time in `/STATS P`.
authorSadie Powell <sadie@witchery.services>
Sun, 18 Apr 2021 15:49:38 +0000 (16:49 +0100)
committerSadie Powell <sadie@witchery.services>
Sun, 18 Apr 2021 15:49:38 +0000 (16:49 +0100)
src/coremods/core_stats.cpp

index 19e429a95e92089924cc590e47ea39f69b791116..6ce733db7c4bdf47fbca37c61240573941f4e058 100644 (file)
@@ -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++;
                                }
                        }