From 57608fe351cff19679b1d78fb5cbfb7cad89dfc1 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 2 Apr 2008 23:53:29 +0000 Subject: Fixes for bug #493, tidyups to clearing of channel modes on losing FJOIN. Module unloads may also be tidied at a future date but it means reordering some loops in mode.cpp. See around the comment added. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9283 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modes/cmode_k.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/modes/cmode_k.cpp') diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index 21b5d8464..194c0efcb 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -33,7 +33,7 @@ ModePair ModeChannelKey::ModeSet(User*, User*, Channel* channel, const std::stri } } -void ModeChannelKey::RemoveMode(Channel* channel) +void ModeChannelKey::RemoveMode(Channel* channel, irc::modestacker* stack) { /** +k needs a parameter when being removed, * so we have a special-case RemoveMode here for it @@ -43,12 +43,17 @@ void ModeChannelKey::RemoveMode(Channel* channel) if (channel->IsModeSet(this->GetModeChar())) { - sprintf(moderemove,"-%c",this->GetModeChar()); - ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); + if (stack) + stack->Push(this->GetModeChar(), channel->key); + else + { + sprintf(moderemove,"-%c",this->GetModeChar()); + ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); + } } } -void ModeChannelKey::RemoveMode(User*) +void ModeChannelKey::RemoveMode(User*, irc::modestacker* stack) { } -- cgit v1.2.3