X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodes%2Fcmode_v.cpp;h=f12d9f9cfbcda3679f3c0033975649981f5c9344;hb=c0f8576bbd4cfa5b4f0c13cad90c3b516e0efb43;hp=b93a04f4981d3d2c2d2335800d42fae521a57ccb;hpb=396c9ef9f7a96934d3227bb7d1d091315e3d4fa8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp index b93a04f49..f12d9f9cf 100644 --- a/src/modes/cmode_v.cpp +++ b/src/modes/cmode_v.cpp @@ -7,23 +7,19 @@ #include "mode.h" #include "channels.h" #include "users.h" -#include "helperfuncs.h" -#include "message.h" #include "commands.h" #include "modules.h" #include "inspstring.h" #include "hashcomp.h" #include "modes/cmode_v.h" -extern InspIRCd* ServerInstance; - -extern std::vector modules; -extern std::vector factory; -extern int MODCOUNT; -extern time_t TIME; +ModeChannelVoice::ModeChannelVoice(InspIRCd* Instance) : ModeHandler(Instance, 'v', 1, 1, true, MODETYPE_CHANNEL, false, '+') +{ +} -ModeChannelVoice::ModeChannelVoice() : ModeHandler('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 ¶meter) @@ -31,7 +27,7 @@ ModePair ModeChannelVoice::ModeSet(userrec* source, userrec* dest, chanrec* chan userrec* x = ServerInstance->FindNick(parameter); if (x) { - if (cstatus(x, channel) == STATUS_VOICE) + if (channel->GetStatusFlags(x) & UCMODE_VOICE) { return std::make_pair(true, x->nick); } @@ -45,7 +41,7 @@ ModePair ModeChannelVoice::ModeSet(userrec* source, userrec* dest, chanrec* chan ModeAction ModeChannelVoice::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { - int status = cstatus(source, channel); + int status = channel->GetStatus(source); /* Call the correct method depending on wether we're adding or removing the mode */ if (adding) @@ -66,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 = ModeParser::SanityChecks(user,dest,chan,status); + userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -79,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 ""; @@ -87,14 +83,14 @@ std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *c } } - return ModeParser::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 = ModeParser::SanityChecks(user,dest,chan,status); + userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -107,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 ""; @@ -115,7 +111,7 @@ std::string ModeChannelVoice::DelVoice(userrec *user,const char *dest,chanrec *c } } - return ModeParser::Revoke(d,chan,UCMODE_VOICE); + return ServerInstance->Modes->Revoke(d,chan,UCMODE_VOICE); } return ""; }