diff options
| author | 2022-03-27 07:07:29 +0100 | |
|---|---|---|
| committer | 2022-03-27 16:09:19 +0100 | |
| commit | 414105e409cf8b90c3d9d417bb73795b19d843c4 (patch) | |
| tree | 38ba2fdca1620920aaa34f536a720851e326d748 /src/modules/m_disable.cpp | |
| parent | Undocument removed config option. (diff) | |
| download | inspircd++-414105e409cf8b90c3d9d417bb73795b19d843c4.tar.gz inspircd++-414105e409cf8b90c3d9d417bb73795b19d843c4.tar.bz2 inspircd++-414105e409cf8b90c3d9d417bb73795b19d843c4.zip | |
Add a typedef for the mode status bitset.
Diffstat (limited to 'src/modules/m_disable.cpp')
| -rw-r--r-- | src/modules/m_disable.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/modules/m_disable.cpp b/src/modules/m_disable.cpp index 32201cfe1..a0be744e3 100644 --- a/src/modules/m_disable.cpp +++ b/src/modules/m_disable.cpp @@ -29,20 +29,17 @@ enum // Holds a list of disabled commands. typedef std::vector<std::string> CommandList; -// Holds whether modes are disabled or not. -typedef std::bitset<64> ModeStatus; - class ModuleDisable final : public Module { private: CommandList commands; - ModeStatus chanmodes; + ModeParser::ModeStatus chanmodes; bool fakenonexistent; bool notifyopers; - ModeStatus usermodes; + ModeParser::ModeStatus usermodes; - void ReadModes(std::shared_ptr<ConfigTag> tag, const std::string& field, ModeType type, ModeStatus& status) + void ReadModes(std::shared_ptr<ConfigTag> tag, const std::string& field, ModeType type, ModeParser::ModeStatus& status) { for (const auto& chr : tag->getString(field)) { @@ -106,11 +103,11 @@ public: } // Parse the disabled channel modes. - ModeStatus newchanmodes; + ModeParser::ModeStatus newchanmodes; ReadModes(tag, "chanmodes", MODETYPE_CHANNEL, newchanmodes); // Parse the disabled user modes. - ModeStatus newusermodes; + ModeParser::ModeStatus newusermodes; ReadModes(tag, "usermodes", MODETYPE_USER, newusermodes); // The server config was valid so we can use these now. @@ -160,7 +157,7 @@ public: return MOD_RES_PASSTHRU; // If the mode is not disabled or the user has the servers/use-disabled-modes priv we do nothing. - const std::bitset<64>& disabled = (change.mh->GetModeType() == MODETYPE_CHANNEL) ? chanmodes : usermodes; + const ModeParser::ModeStatus& disabled = (change.mh->GetModeType() == MODETYPE_CHANNEL) ? chanmodes : usermodes; if (!disabled.test(change.mh->GetModeChar() - 'A') || user->HasPrivPermission("servers/use-disabled-modes")) return MOD_RES_PASSTHRU; |
