diff options
| author | 2013-06-18 19:10:07 +0200 | |
|---|---|---|
| committer | 2013-07-19 19:40:04 +0200 | |
| commit | fd1d19d6345943ecdb5ce4ef947f9b3c5c8bca86 (patch) | |
| tree | 20ce1866b482808a85b34c7c09e53c3159617bc0 /src/modules/m_operprefix.cpp | |
| parent | Move SetNoticeMask(), FormatNoticeMasks() and ProcessNoticeMasks() from the U... (diff) | |
Replace hardcoded mode letters, part 3
This changes most remaining User::IsModeSet() calls to use ModeReferences for modes that were created by other modules or the core
Diffstat (limited to 'src/modules/m_operprefix.cpp')
| -rw-r--r-- | src/modules/m_operprefix.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp index 1f820c745..643f09db9 100644 --- a/src/modules/m_operprefix.cpp +++ b/src/modules/m_operprefix.cpp @@ -68,10 +68,12 @@ class ModuleOperPrefixMode : public Module { OperPrefixMode opm; HideOperWatcher hideoperwatcher; + UserModeReference hideopermode; public: ModuleOperPrefixMode() : opm(this), hideoperwatcher(this) + , hideopermode(this, "hideoper") { } @@ -92,7 +94,7 @@ class ModuleOperPrefixMode : public Module ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE { - if ((user->IsOper()) && (user->IsModeSet('H'))) + if ((user->IsOper()) && (!user->IsModeSet(hideopermode))) privs.push_back('y'); return MOD_RES_PASSTHRU; } @@ -101,7 +103,8 @@ class ModuleOperPrefixMode : public Module { std::vector<std::string> modechange; modechange.push_back(""); - modechange.push_back(add ? "+y" : "-y"); + modechange.push_back(add ? "+" : "-"); + modechange[1].push_back(opm.GetModeChar()); modechange.push_back(user->nick); for (UCListIter v = user->chans.begin(); v != user->chans.end(); v++) { @@ -112,7 +115,7 @@ class ModuleOperPrefixMode : public Module void OnPostOper(User* user, const std::string& opername, const std::string& opertype) CXX11_OVERRIDE { - if (IS_LOCAL(user) && (!user->IsModeSet('H'))) + if (IS_LOCAL(user) && (!user->IsModeSet(hideopermode))) SetOperPrefix(user, true); } |
