X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_namedmodes.cpp;h=73c5cb521fdc919572e5576ca2a474b8fef6a3da;hb=b7716ed57704b2b2bcc665a590aecc8f02de631d;hp=d4263d899d46a741ee20482736043b904f18577c;hpb=f71fe202e54f90190f3b5562de7926eb8265f3e5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp index d4263d899..73c5cb521 100644 --- a/src/modules/m_namedmodes.cpp +++ b/src/modules/m_namedmodes.cpp @@ -19,9 +19,16 @@ #include "inspircd.h" +enum +{ + // InspIRCd-specific. + RPL_ENDOFPROPLIST = 960, + RPL_PROPLIST = 961 +}; + static void DisplayList(LocalUser* user, Channel* channel) { - Numeric::ParamBuilder<1> numeric(user, 961); + Numeric::ParamBuilder<1> numeric(user, RPL_PROPLIST); numeric.AddStatic(channel->name); const ModeParser::ModeHandlerMap& mhs = ServerInstance->Modes->GetModes(MODETYPE_CHANNEL); @@ -31,7 +38,7 @@ static void DisplayList(LocalUser* user, Channel* channel) if (!channel->IsModeSet(mh)) continue; numeric.Add("+" + mh->name); - if (mh->GetNumParams(true)) + if (mh->NeedsParam(true)) { if ((mh->name == "key") && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex"))) numeric.Add(""); @@ -40,7 +47,7 @@ static void DisplayList(LocalUser* user, Channel* channel) } } numeric.Flush(); - user->WriteNumeric(960, channel->name, "End of mode list"); + user->WriteNumeric(RPL_ENDOFPROPLIST, channel->name, "End of mode list"); } class CommandProp : public SplitCommand @@ -52,12 +59,12 @@ class CommandProp : public SplitCommand syntax = " {[+-] []}*"; } - CmdResult HandleLocal(const std::vector& parameters, LocalUser* src) + CmdResult HandleLocal(const std::vector& parameters, LocalUser* src) CXX11_OVERRIDE { Channel* const chan = ServerInstance->FindChan(parameters[0]); if (!chan) { - src->WriteNumeric(Numerics::NoSuchNick(parameters[0])); + src->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); return CMD_FAILURE; } @@ -80,7 +87,7 @@ class CommandProp : public SplitCommand ModeHandler* mh = ServerInstance->Modes->FindMode(prop, MODETYPE_CHANNEL); if (mh) { - if (mh->GetNumParams(plus)) + if (mh->NeedsParam(plus)) { if (i != parameters.size()) modes.push(mh, plus, parameters[i++]); @@ -103,7 +110,7 @@ class DummyZ : public ModeHandler } // Handle /MODE #chan Z - void DisplayList(User* user, Channel* chan) + void DisplayList(User* user, Channel* chan) CXX11_OVERRIDE { if (IS_LOCAL(user)) ::DisplayList(static_cast(user), chan); @@ -124,7 +131,7 @@ class ModuleNamedModes : public Module return Version("Provides the ability to manipulate modes via long names.",VF_VENDOR); } - void Prioritize() + void Prioritize() CXX11_OVERRIDE { ServerInstance->Modules->SetPriority(this, I_OnPreMode, PRIORITY_FIRST); } @@ -161,7 +168,7 @@ class ModuleNamedModes : public Module } curr.param.clear(); - if (mh->GetNumParams(curr.adding)) + if (mh->NeedsParam(curr.adding)) { if (value.empty()) {