summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-02-22 04:16:24 +0000
committerSadie Powell <sadie@witchery.services>2021-02-22 04:22:25 +0000
commit70f4f0225cf4357b6fa3c57cd63b49da79b9eeef (patch)
tree2b34b615160fe59ce1c2f526d03200ea83065d06
parent262ad80560b168da596a2c2874f07c9fe263bf35 (diff)
Add snomask permissions to the oper check output.
-rw-r--r--src/modules/m_check.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 5434f8054..3291c63e6 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -146,6 +146,15 @@ class CommandCheck : public Command
return ret;
}
+ static std::string GetAllowedOperOnlySnomasks(LocalUser* user)
+ {
+ std::string ret;
+ for (unsigned char sno = 'A'; sno <= 'z'; ++sno)
+ if (ServerInstance->SNO->IsSnomaskUsable(sno) && user->HasSnomaskPermission(sno))
+ ret.push_back(sno);
+ return ret;
+ }
+
public:
CommandCheck(Module* parent)
: Command(parent,"CHECK", 1)
@@ -209,6 +218,7 @@ class CommandCheck : public Command
{
context.Write("chanmodeperms", GetAllowedOperOnlyModes(loctarg, MODETYPE_CHANNEL));
context.Write("usermodeperms", GetAllowedOperOnlyModes(loctarg, MODETYPE_USER));
+ context.Write("snomaskperms", GetAllowedOperOnlySnomasks(loctarg));
context.Write("commandperms", oper->AllowedOperCommands.ToString());
context.Write("permissions", oper->AllowedPrivs.ToString());
}