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_cloaking.cpp | |
parent | 93b12896dab1692800c4b6d2d9f35e1a23102028 (diff) |
Replace hardcoded mode letters passed to IsModeSet() and GetModeParameter() with ModeHandlers, part 1
Diffstat (limited to 'src/modules/m_cloaking.cpp')
-rw-r--r-- | src/modules/m_cloaking.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index ccc98e557..5613a137f 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -65,7 +65,7 @@ class CloakUser : public ModeHandler */ if (!user) { - dest->SetMode('x',adding); + dest->SetMode(this, adding); return MODEACTION_ALLOW; } @@ -82,7 +82,7 @@ class CloakUser : public ModeHandler debounce_ts = ServerInstance->Time(); } - if (adding == user->IsModeSet('x')) + if (adding == user->IsModeSet(this)) return MODEACTION_DENY; /* don't allow this user to spam modechanges */ @@ -102,7 +102,7 @@ class CloakUser : public ModeHandler if (cloak) { user->ChangeDisplayedHost(cloak->c_str()); - user->SetMode('x',true); + user->SetMode(this, true); return MODEACTION_ALLOW; } else @@ -113,7 +113,7 @@ class CloakUser : public ModeHandler /* User is removing the mode, so restore their real host * and make it match the displayed one. */ - user->SetMode('x',false); + user->SetMode(this, false); user->ChangeDisplayedHost(user->host.c_str()); return MODEACTION_ALLOW; } @@ -312,10 +312,10 @@ class ModuleCloaking : public Module // mode change, we will call SetMode back to true AFTER the host change is done. void OnChangeHost(User* u, const std::string& host) CXX11_OVERRIDE { - if(u->IsModeSet('x')) + if (u->IsModeSet(cu)) { - u->SetMode('x', false); - u->WriteServ("MODE %s -x", u->nick.c_str()); + u->SetMode(cu, false); + u->WriteServ("MODE %s -%c", u->nick.c_str(), cu.GetModeChar()); } } |