summaryrefslogtreecommitdiff
path: root/src/modes
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/cmode_k.cpp14
-rw-r--r--src/modes/cmode_l.cpp7
2 files changed, 7 insertions, 14 deletions
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp
index f2afb9ac0..a7c491aa5 100644
--- a/src/modes/cmode_k.cpp
+++ b/src/modes/cmode_k.cpp
@@ -94,20 +94,16 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s
if (parameter.rfind(' ') != std::string::npos)
return MODEACTION_DENY;
- /* must first unset if we are changing the key, otherwise it will be ignored */
- if (exists && adding)
- channel->SetMode('k', false);
-
- /* must run setmode always, to process the change */
- channel->SetMode('k', adding);
-
if (adding)
{
std::string ckey;
ckey.assign(parameter, 0, 32);
parameter = ckey;
- /* running this does not run setmode, despite the third parameter */
- channel->SetModeParam('k', parameter.c_str(), true);
+ channel->SetMode('k', parameter);
+ }
+ else
+ {
+ channel->SetMode('k', "");
}
return MODEACTION_ALLOW;
}
diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp
index e87a524b2..3d37fc900 100644
--- a/src/modes/cmode_l.cpp
+++ b/src/modes/cmode_l.cpp
@@ -54,8 +54,7 @@ ModeAction ModeChannelLimit::OnModeChange(User*, User*, Channel* channel, std::s
parameter = ConvToStr(limit);
/* Set new limit */
- channel->SetModeParam('l', parameter.c_str(), true);
- channel->modes[CM_LIMIT] = 1;
+ channel->SetMode('l', parameter);
return MODEACTION_ALLOW;
}
@@ -71,9 +70,7 @@ ModeAction ModeChannelLimit::OnModeChange(User*, User*, Channel* channel, std::s
}
/* Removing old limit, no checks here */
- channel->SetModeParam('l', "", false);
- channel->modes[CM_LIMIT] = 0;
-
+ channel->SetMode('l', "");
return MODEACTION_ALLOW;
}
}