From 2d004034febfecf9ba0662406df7ecec67efbacf Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 7 Mar 2009 04:54:50 +0000 Subject: Let's try that +k fix again, this time with more testing git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11184 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modes/cmode_k.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index 092f69fca..a09131354 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -91,12 +91,11 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s if (parameter.rfind(' ') != std::string::npos) return MODEACTION_DENY; - channel->SetMode('k', adding); - if (adding) { - std::string ckey; - ckey.assign(parameter, 0, 32); - channel->SetModeParam('k', ckey.c_str(), adding); - parameter = ckey; - } + std::string ckey; + ckey.assign(parameter, 0, 32); + parameter = ckey; + if (adding && exists) + channel->SetMode('k', false); + channel->SetModeParam('k', parameter.c_str(), adding); return MODEACTION_ALLOW; } -- cgit v1.2.3