diff options
| author | 2022-03-27 07:57:50 +0100 | |
|---|---|---|
| committer | 2022-03-27 16:09:19 +0100 | |
| commit | 056d0b43831857c7258fa734d0ecac05858fa449 (patch) | |
| tree | 406aaaef7c80c9b55fcbb7d2af45c6bf7c4c3d2d /src/modules/m_disable.cpp | |
| parent | Add a typedef for the mode status bitset. (diff) | |
Pack the mode set more efficiently and add support for numeric modes.
Diffstat (limited to 'src/modules/m_disable.cpp')
| -rw-r--r-- | src/modules/m_disable.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_disable.cpp b/src/modules/m_disable.cpp index a0be744e3..984470bed 100644 --- a/src/modules/m_disable.cpp +++ b/src/modules/m_disable.cpp @@ -57,7 +57,7 @@ private: // Disable the mode. ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "The %c (%s) %s mode has been disabled", mh->GetModeChar(), mh->name.c_str(), type == MODETYPE_CHANNEL ? "channel" : "user"); - status.set(chr - 'A'); + status.set(ModeParser::GetModeIndex(chr)); } } @@ -158,7 +158,7 @@ public: // If the mode is not disabled or the user has the servers/use-disabled-modes priv we do nothing. const ModeParser::ModeStatus& disabled = (change.mh->GetModeType() == MODETYPE_CHANNEL) ? chanmodes : usermodes; - if (!disabled.test(change.mh->GetModeChar() - 'A') || user->HasPrivPermission("servers/use-disabled-modes")) + if (!disabled.test(ModeParser::GetModeIndex(change.mh->GetModeChar())) || user->HasPrivPermission("servers/use-disabled-modes")) return MOD_RES_PASSTHRU; // The user has tried to change a disabled mode! |
