]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/cmode_o.cpp
Fixes for bug #493, tidyups to clearing of channel modes on losing FJOIN. Module...
[user/henk/code/inspircd.git] / src / modes / cmode_o.cpp
index a43eaeac9c59a5a65fc530c0a0e02e7437358774..c4e3c241e8921799b182888aa1d1b5b20cc64d6f 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
@@ -28,7 +28,7 @@ unsigned int ModeChannelOp::GetPrefixRank()
        return OP_VALUE;
 }
 
-ModePair ModeChannelOp::ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
+ModePair ModeChannelOp::ModeSet(User*, User*, Channel* channel, const std::string &parameter)
 {
        User* x = ServerInstance->FindNick(parameter);
        if (x)
@@ -46,13 +46,13 @@ ModePair ModeChannelOp::ModeSet(User* source, User* dest, Channel* channel, cons
 }
 
 
-void ModeChannelOp::RemoveMode(Channel* channel)
+void ModeChannelOp::RemoveMode(Channel* channel, irc::modestacker* stack)
 {
-       CUList* list = channel->GetOppedUsers();
+       CUList* clist = channel->GetOppedUsers();
        CUList copy;
        char moderemove[MAXBUF];
 
-       for (CUList::iterator i = list->begin(); i != list->end(); i++)
+       for (CUList::iterator i = clist->begin(); i != clist->end(); i++)
        {
                User* n = i->first;
                copy.insert(std::make_pair(n,n->nick));
@@ -60,17 +60,22 @@ void ModeChannelOp::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 ModeChannelOp::RemoveMode(User* user)
+void ModeChannelOp::RemoveMode(User*, irc::modestacker* stack)
 {
 }
 
-ModeAction ModeChannelOp::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
+ModeAction ModeChannelOp::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
 {
        int status = channel->GetStatus(source);