From f72b30c9fa873507d70c2b71f13600792039ecae Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 27 Feb 2023 21:53:58 +0000 Subject: [PATCH] Allow differentiating non-oper helpers from opers. --- docs/conf/modules.conf.example | 6 ++++-- src/modules/m_helpmode.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index a299e7e8b..4f57a2a3e 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1070,8 +1070,10 @@ # # # If you also use the hideoper module you can allow hidden opers with -# the help mode set still to be included in `/STATS P`. -# +# the help mode set to to be included in `/STATS P` and mark helpers +# as such to differentiate them from opers. +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Hide chans module: Allows users to hide their channels list from non- diff --git a/src/modules/m_helpmode.cpp b/src/modules/m_helpmode.cpp index ee08a121c..0746cd176 100644 --- a/src/modules/m_helpmode.cpp +++ b/src/modules/m_helpmode.cpp @@ -56,6 +56,7 @@ private: bool ignorehideoper; HelpOp helpop; UserModeReference hideoper; + bool markhelpers; public: ModuleHelpMode() @@ -70,7 +71,8 @@ public: void ReadConfig(ConfigStatus& status) override { const auto& tag = ServerInstance->Config->ConfValue("helpmode"); - ignorehideoper = tag->getBool("ignorehideoper", false); + ignorehideoper = tag->getBool("ignorehideoper"); + markhelpers = tag->getBool("markhelpers", true); } ModResult OnStats(Stats::Context& stats) override @@ -84,7 +86,7 @@ public: continue; // Ignore services. if (helper->IsOper() && (!ignorehideoper || !helper->IsModeSet(hideoper))) - continue; // Ignore helpers. + continue; // Ignore opers. std::string extra; if (helper->IsAway()) @@ -104,7 +106,8 @@ public: extra += INSP_FORMAT("{} idle for {} [since {}]", extra.empty() ? ':' : ',', idleperiod, idletime); } - stats.AddGenericRow(INSP_FORMAT("\x02{}\x02 ({}){}", helper->nick, helper->GetRealUserHost(), extra)); + stats.AddGenericRow(INSP_FORMAT("\x02{}\x02{} ({}){}", helper->nick, markhelpers ? " [helper]" : "", + helper->GetRealUserHost(), extra)); } // Allow the core to add normal opers.