]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/cmode_v.cpp
auto-set +s when +n is set (as +n requires +s) - allow +n to be 'set twice' allowing...
[user/henk/code/inspircd.git] / src / modes / cmode_v.cpp
index c834c47fd03ce3e29d235b1f8e7296651fe73b63..f12d9f9cfbcda3679f3c0033975649981f5c9344 100644 (file)
@@ -7,17 +7,19 @@
 #include "mode.h"
 #include "channels.h"
 #include "users.h"
-#include "helperfuncs.h"
 #include "commands.h"
 #include "modules.h"
 #include "inspstring.h"
 #include "hashcomp.h"
 #include "modes/cmode_v.h"
 
-extern time_t TIME;
+ModeChannelVoice::ModeChannelVoice(InspIRCd* Instance) : ModeHandler(Instance, 'v', 1, 1, true, MODETYPE_CHANNEL, false, '+')
+{
+}
 
-ModeChannelVoice::ModeChannelVoice(InspIRCd* Instance) : ModeHandler(Instance, 'v', 1, 1, true, MODETYPE_CHANNEL, false)
+unsigned int ModeChannelVoice::GetPrefixRank()
 {
+       return VOICE_VALUE;
 }
 
 ModePair ModeChannelVoice::ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
@@ -25,7 +27,7 @@ ModePair ModeChannelVoice::ModeSet(userrec* source, userrec* dest, chanrec* chan
        userrec* x = ServerInstance->FindNick(parameter);
        if (x)
        {
-               if (channel->GetStatus(x) == STATUS_VOICE)
+               if (channel->GetStatusFlags(x) & UCMODE_VOICE)
                {
                        return std::make_pair(true, x->nick);
                }
@@ -60,7 +62,7 @@ ModeAction ModeChannelVoice::OnModeChange(userrec* source, userrec* dest, chanre
 
 std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *chan,int status)
 {
-       userrec *d = ServerInstance->ModeGrok->SanityChecks(user,dest,chan,status);
+       userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status);
 
        if (d)
        {
@@ -73,7 +75,7 @@ std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *c
                                return "";
                        if (MOD_RESULT == ACR_DEFAULT)
                        {
-                               if ((status < STATUS_HOP) && (!is_uline(user->server)))
+                               if ((status < STATUS_HOP) && (!ServerInstance->ULine(user->server)))
                                {
                                        user->WriteServ("482 %s %s :You're not a channel (half)operator",user->nick, chan->name);
                                        return "";
@@ -81,14 +83,14 @@ std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *c
                        }
                }
 
-               return ServerInstance->ModeGrok->Grant(d,chan,UCMODE_VOICE);
+               return ServerInstance->Modes->Grant(d,chan,UCMODE_VOICE);
        }
        return "";
 }
 
 std::string ModeChannelVoice::DelVoice(userrec *user,const char *dest,chanrec *chan,int status)
 {
-       userrec *d = ServerInstance->ModeGrok->SanityChecks(user,dest,chan,status);
+       userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status);
 
        if (d)
        {
@@ -101,7 +103,7 @@ std::string ModeChannelVoice::DelVoice(userrec *user,const char *dest,chanrec *c
                                return "";
                        if (MOD_RESULT == ACR_DEFAULT)
                        {
-                               if ((status < STATUS_HOP) && (!is_uline(user->server)))
+                               if ((status < STATUS_HOP) && (!ServerInstance->ULine(user->server)))
                                {
                                        user->WriteServ("482 %s %s :You are not a channel (half)operator",user->nick, chan->name);
                                        return "";
@@ -109,7 +111,7 @@ std::string ModeChannelVoice::DelVoice(userrec *user,const char *dest,chanrec *c
                        }
                }
 
-               return ServerInstance->ModeGrok->Revoke(d,chan,UCMODE_VOICE);
+               return ServerInstance->Modes->Revoke(d,chan,UCMODE_VOICE);
        }
        return "";
 }