diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-07 04:54:50 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-07 04:54:50 +0000 |
commit | 2d004034febfecf9ba0662406df7ecec67efbacf (patch) | |
tree | fe6bfa2b6d1dec88b671fd633c01a3cfef3f6e1f /src | |
parent | acb72fdf2d66d71e5b70ec5d3c3dcf9f8d8df655 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/modes/cmode_k.cpp | 13 |
1 files 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; } |