From f2cdf27dd9c45f91f4184b81ea3b9be7c5d88173 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Thu, 11 Apr 2013 23:47:45 +0200 Subject: Replace hardcoded mode letters passed to IsModeSet() and GetModeParameter() with ModeHandlers, part 1 --- src/modules/m_servprotect.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modules/m_servprotect.cpp') 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; } }; -- cgit v1.2.3