]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_check.cpp
Add snomask permissions to the oper check output.
[user/henk/code/inspircd.git] / src / modules / m_check.cpp
index 5434f805496b9ee54628d7b65a29aa63690aa5b5..3291c63e6c7eb05075e8c0c627c4990c38435650 100644 (file)
@@ -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());
                                }