diff options
| author | 2022-11-27 07:32:42 +0000 | |
|---|---|---|
| committer | 2022-11-28 02:57:50 +0000 | |
| commit | ee44af8d04f23b4a16c9b377764f930d69e575f7 (patch) | |
| tree | 4348a9d4b76ea65266875651d57d2ebf3e1d7894 /src/modules/m_override.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
Refactor the internals of the oper system.
- Allow overriding privileges from the <class> blocks in the <type>
and <oper> blocks.
- Separate oper types from oper accounts in the code. This enables
moving some core stuff out of the config tag later.
- Merge the config tags together to make a synthetic tag that can
have getXXX called on it instead of using getConfig and then
converting it.
- Move the details of Have*Permission into the oper type class.
- Improve oper events to allow modules to easily hook into the oper
system.
Diffstat (limited to 'src/modules/m_override.cpp')
| -rw-r--r-- | src/modules/m_override.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index f74453a65..348889de5 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -162,9 +162,7 @@ public: if (!source->IsModeSet(ou)) return false; - std::string tokenlist = source->oper->getConfig("override"); - // its defined or * is set, return its value as a boolean for if the token is set - return ((tokenlist.find(token, 0) != std::string::npos) || (tokenlist.find('*', 0) != std::string::npos)); + return TokenList(source->oper->GetConfig()->getString("override")).Contains(token); } ModResult OnPreTopicChange(User* source, Channel* channel, const std::string& topic) override |
