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_v.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/modes/cmode_v.cpp') diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp index 45a9e1879..15196d4a8 100644 --- a/src/modes/cmode_v.cpp +++ b/src/modes/cmode_v.cpp @@ -46,7 +46,7 @@ ModePair ModeChannelVoice::ModeSet(User*, User*, Channel* channel, const std::st return std::make_pair(false, parameter); } -void ModeChannelVoice::RemoveMode(Channel* channel) +void ModeChannelVoice::RemoveMode(Channel* channel, irc::modestacker* stack) { CUList* clist = channel->GetVoicedUsers(); CUList copy; @@ -60,13 +60,18 @@ void ModeChannelVoice::RemoveMode(Channel* channel) for (CUList::iterator i = copy.begin(); i != copy.end(); i++) { - sprintf(moderemove,"-%c",this->GetModeChar()); - const char* parameters[] = { channel->name, moderemove, i->first->nick }; - ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); + if (stack) + stack->Push(this->GetModeChar(), i->first->nick); + else + { + sprintf(moderemove,"-%c",this->GetModeChar()); + const char* parameters[] = { channel->name, moderemove, i->first->nick }; + ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); + } } } -void ModeChannelVoice::RemoveMode(User*) +void ModeChannelVoice::RemoveMode(User*, irc::modestacker* stack) { } -- cgit v1.2.3