summaryrefslogtreecommitdiff
path: root/src/modes
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-11 23:47:45 +0200
committerattilamolnar <attilamolnar@hush.com>2013-07-01 19:21:08 +0200
commitf2cdf27dd9c45f91f4184b81ea3b9be7c5d88173 (patch)
tree2af494a7cf74fc8731e6cae695ae37a2267b6d5e /src/modes
parent93b12896dab1692800c4b6d2d9f35e1a23102028 (diff)
Replace hardcoded mode letters passed to IsModeSet() and GetModeParameter() with ModeHandlers, part 1
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/cmode_k.cpp6
-rw-r--r--src/modes/umode_s.cpp8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp
index f07d47172..e56b26ff1 100644
--- a/src/modes/cmode_k.cpp
+++ b/src/modes/cmode_k.cpp
@@ -32,18 +32,18 @@ ModeChannelKey::ModeChannelKey() : ModeHandler(NULL, "key", 'k', PARAM_ALWAYS, M
ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
{
- bool exists = channel->IsModeSet('k');
+ bool exists = channel->IsModeSet(this);
if (IS_LOCAL(source))
{
if (exists == adding)
return MODEACTION_DENY;
- if (exists && (parameter != channel->GetModeParameter('k')))
+ if (exists && (parameter != channel->GetModeParameter(this)))
{
/* Key is currently set and the correct key wasnt given */
return MODEACTION_DENY;
}
} else {
- if (exists && adding && parameter == channel->GetModeParameter('k'))
+ if (exists && adding && parameter == channel->GetModeParameter(this))
{
/* no-op, don't show */
return MODEACTION_DENY;
diff --git a/src/modes/umode_s.cpp b/src/modes/umode_s.cpp
index 9473d760e..f5631c695 100644
--- a/src/modes/umode_s.cpp
+++ b/src/modes/umode_s.cpp
@@ -36,18 +36,18 @@ ModeAction ModeUserServerNoticeMask::OnModeChange(User* source, User* dest, Chan
if (adding)
{
/* Fix for bug #310 reported by Smartys */
- if (!dest->modes[UM_SNOMASK])
+ if (!dest->IsModeSet(this))
dest->snomasks.reset();
- dest->modes[UM_SNOMASK] = true;
+ dest->SetMode(this, true);
parameter = dest->ProcessNoticeMasks(parameter.c_str());
return MODEACTION_ALLOW;
}
else
{
- if (dest->modes[UM_SNOMASK] != false)
+ if (dest->IsModeSet(this))
{
- dest->modes[UM_SNOMASK] = false;
+ dest->SetMode(this, false);
return MODEACTION_ALLOW;
}
}