mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Allow differentiating non-oper helpers from opers.
This commit is contained in:
parent
2597dcd153
commit
f72b30c9fa
@ -1070,8 +1070,10 @@
|
||||
#<module name="helpmode">
|
||||
#
|
||||
# If you also use the hideoper module you can allow hidden opers with
|
||||
# the help mode set still to be included in `/STATS P`.
|
||||
# <hideoper ignorehideoper="no">
|
||||
# the help mode set to to be included in `/STATS P` and mark helpers
|
||||
# as such to differentiate them from opers.
|
||||
# <hideoper ignorehideoper="no"
|
||||
# markhelpers="yes">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# Hide chans module: Allows users to hide their channels list from non-
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user