X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_rmode.cpp;h=ce28630b4704c6017bf8b1ffd412edcf736a2949;hb=de4e4860091fe5a9a530acdb25f9a17e22323acf;hp=c81fbd7e7f15f9a0c61f58740436481c13fe7361;hpb=f62654a6859998f9d63eb22702c572d5ebcff15c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_rmode.cpp b/src/modules/m_rmode.cpp index c81fbd7e7..ce28630b4 100644 --- a/src/modules/m_rmode.cpp +++ b/src/modules/m_rmode.cpp @@ -31,7 +31,7 @@ class CommandRMode : public Command syntax = " [pattern]"; } - CmdResult Handle(const std::vector ¶meters, User *user) + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { ModeHandler* mh; Channel* chan = ServerInstance->FindChan(parameters[0]); @@ -50,7 +50,7 @@ class CommandRMode : public Command return CMD_FAILURE; } - if (chan->GetPrefixValue(user) < mh->GetLevelRequired()) + if (chan->GetPrefixValue(user) < mh->GetLevelRequired(false)) { user->WriteNotice("You do not have access to unset " + ConvToStr(modeletter) + " on " + chan->name + "."); return CMD_FAILURE; @@ -60,7 +60,7 @@ class CommandRMode : public Command PrefixMode* pm; ListModeBase* lm; ListModeBase::ModeList* ml; - irc::modestacker modestack(false); + Modes::ChangeList changelist; if ((pm = mh->IsPrefixMode())) { @@ -70,8 +70,8 @@ class CommandRMode : public Command { if (!InspIRCd::Match(it->first->nick, pattern)) continue; - if (it->second->hasMode(modeletter) && !((it->first == user) && (pm->GetPrefixRank() > VOICE_VALUE))) - modestack.Push(modeletter, it->first->nick); + if (it->second->HasMode(pm) && !((it->first == user) && (pm->GetPrefixRank() > VOICE_VALUE))) + changelist.push_remove(mh, it->first->nick); } } else if ((lm = mh->IsListModeBase()) && ((ml = lm->GetList(chan)) != NULL)) @@ -80,23 +80,16 @@ class CommandRMode : public Command { if (!InspIRCd::Match(it->mask, pattern)) continue; - modestack.Push(modeletter, it->mask); + changelist.push_remove(mh, it->mask); } } else { if (chan->IsModeSet(mh)) - modestack.Push(modeletter); - } - - parameterlist stackresult; - stackresult.push_back(chan->name); - while (modestack.GetStackedLine(stackresult)) - { - ServerInstance->Modes->Process(stackresult, user); - stackresult.erase(stackresult.begin() + 1, stackresult.end()); + changelist.push_remove(mh); } + ServerInstance->Modes->Process(user, chan, NULL, changelist); return CMD_SUCCESS; } };