]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/cmode_k.cpp
Fixes for bug #493, tidyups to clearing of channel modes on losing FJOIN. Module...
[user/henk/code/inspircd.git] / src / modes / cmode_k.cpp
index 11f13c3231cc258cc93d14fc8e9b2c4c3a5ed6d7..194c0efcbc0a14c679cdd9421dd1d2c9f3e5e680 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -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)
 {
 }
 
@@ -58,7 +63,7 @@ bool ModeChannelKey::CheckTimeStamp(time_t, time_t, const std::string &their_par
        return (their_param < our_param);
 }
 
-ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
+ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
 {
        if ((channel->modes[CM_KEY] != adding) || (!IS_LOCAL(source)))
        {