]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/cmode_v.cpp
fix little typo in syntax hint, type => action
[user/henk/code/inspircd.git] / src / modes / cmode_v.cpp
index 45a9e1879cefe5c963eb400e91cc28508dfe29a3..a89f5705f2fa65d3458be8b7bf533cb98ad16b8d 100644 (file)
@@ -3,7 +3,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -46,11 +46,10 @@ 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;
-       char moderemove[MAXBUF];
 
        for (CUList::iterator i = clist->begin(); i != clist->end(); i++)
        {
@@ -60,13 +59,17 @@ 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
+               {
+                       std::vector<std::string> parameters; parameters.push_back(channel->name); parameters.push_back("-v"); parameters.push_back(i->first->nick);
+                       ServerInstance->SendMode(parameters, ServerInstance->FakeClient);
+               }
        }
 }
 
-void ModeChannelVoice::RemoveMode(User*)
+void ModeChannelVoice::RemoveMode(User*, irc::modestacker* stack)
 {
 }
 
@@ -111,7 +114,7 @@ std::string ModeChannelVoice::AddVoice(User *user,const char* dest,Channel *chan
                        {
                                if ((status < STATUS_HOP) && (!ServerInstance->ULine(user->server)))
                                {
-                                       user->WriteServ("482 %s %s :You're not a channel (half)operator",user->nick, chan->name);
+                                       user->WriteServ("482 %s %s :You're not a channel (half)operator",user->nick.c_str(), chan->name.c_str());
                                        return "";
                                }
                        }
@@ -139,7 +142,7 @@ std::string ModeChannelVoice::DelVoice(User *user,const char *dest,Channel *chan
                        {
                                if ((status < STATUS_HOP) && (!ServerInstance->ULine(user->server)))
                                {
-                                       user->WriteServ("482 %s %s :You are not a channel (half)operator",user->nick, chan->name);
+                                       user->WriteServ("482 %s %s :You are not a channel (half)operator",user->nick.c_str(), chan->name.c_str());
                                        return "";
                                }
                        }