diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_alias.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_operprefix.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_regonlycreate.cpp | 9 |
3 files changed, 21 insertions, 5 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 507a93533..73e3bfd46 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -67,6 +67,7 @@ class ModuleAlias : public Module /* whether or not +B users are allowed to use fantasy commands */ bool AllowBots; + UserModeReference botmode; void ReadAliases() { @@ -96,6 +97,11 @@ class ModuleAlias : public Module } public: + ModuleAlias() + : botmode(this, "bot") + { + } + void init() CXX11_OVERRIDE { ReadAliases(); @@ -187,7 +193,7 @@ class ModuleAlias : public Module } /* Stop here if the user is +B and allowbot is set to no. */ - if (!AllowBots && user->IsModeSet('B')) + if (!AllowBots && user->IsModeSet(botmode)) { return; } 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); } diff --git a/src/modules/m_regonlycreate.cpp b/src/modules/m_regonlycreate.cpp index 84058fbfa..6b6e059df 100644 --- a/src/modules/m_regonlycreate.cpp +++ b/src/modules/m_regonlycreate.cpp @@ -25,7 +25,14 @@ class ModuleRegOnlyCreate : public Module { + UserModeReference regusermode; + public: + ModuleRegOnlyCreate() + : regusermode(this, "u_registered") + { + } + void init() CXX11_OVERRIDE { Implementation eventlist[] = { I_OnUserPreJoin }; @@ -40,7 +47,7 @@ class ModuleRegOnlyCreate : public Module if (user->IsOper()) return MOD_RES_PASSTHRU; - if (user->IsModeSet('r')) + if (user->IsModeSet(regusermode)) return MOD_RES_PASSTHRU; const AccountExtItem* ext = GetAccountExtItem(); |