diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-04-11 23:47:45 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-07-01 19:21:08 +0200 |
commit | f2cdf27dd9c45f91f4184b81ea3b9be7c5d88173 (patch) | |
tree | 2af494a7cf74fc8731e6cae695ae37a2267b6d5e /src/modules/m_servprotect.cpp | |
parent | 93b12896dab1692800c4b6d2d9f35e1a23102028 (diff) |
Replace hardcoded mode letters passed to IsModeSet() and GetModeParameter() with ModeHandlers, part 1
Diffstat (limited to 'src/modules/m_servprotect.cpp')
-rw-r--r-- | src/modules/m_servprotect.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 82ad0920b..32dcc21c0 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -67,7 +67,7 @@ class ModuleServProtectMode : public Module void OnWhois(User* user, User* dest) CXX11_OVERRIDE { - if (dest->IsModeSet('k')) + if (dest->IsModeSet(bm)) { ServerInstance->SendWhoisLine(user, dest, 310, user->nick+" "+dest->nick+" :is a Network Service on "+ServerInstance->Config->Network); } @@ -90,7 +90,7 @@ class ModuleServProtectMode : public Module * This includes any prefix permission mode, even those registered in other modules, e.g. +qaohv. Using ::ModeString() * here means that the number of modes is restricted to only modes the user has, limiting it to as short a loop as possible. */ - if (u->IsModeSet('k') && memb && memb->modes.find(mode) != std::string::npos) + if (u->IsModeSet(bm) && memb && memb->modes.find(mode) != std::string::npos) { /* BZZZT, Denied! */ user->WriteNumeric(482, "%s %s :You are not permitted to remove privileges from %s services", user->nick.c_str(), chan->name.c_str(), ServerInstance->Config->Network.c_str()); @@ -107,7 +107,7 @@ class ModuleServProtectMode : public Module if (src == NULL) return MOD_RES_PASSTHRU; - if (dst->IsModeSet('k')) + if (dst->IsModeSet(bm)) { src->WriteNumeric(485, "%s :You are not permitted to kill %s services!", src->nick.c_str(), ServerInstance->Config->Network.c_str()); ServerInstance->SNO->WriteGlobalSno('a', src->nick+" tried to kill service "+dst->nick+" ("+reason+")"); @@ -118,7 +118,7 @@ class ModuleServProtectMode : public Module ModResult OnUserPreKick(User *src, Membership* memb, const std::string &reason) CXX11_OVERRIDE { - if (memb->user->IsModeSet('k')) + if (memb->user->IsModeSet(bm)) { src->WriteNumeric(484, "%s %s :You are not permitted to kick services", src->nick.c_str(), memb->chan->name.c_str()); @@ -130,7 +130,7 @@ class ModuleServProtectMode : public Module ModResult OnWhoisLine(User* src, User* dst, int &numeric, std::string &text) CXX11_OVERRIDE { - return ((src != dst) && (numeric == 319) && dst->IsModeSet('k')) ? MOD_RES_DENY : MOD_RES_PASSTHRU; + return ((src != dst) && (numeric == 319) && dst->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU; } }; |