X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_namedmodes.cpp;h=f25cc219ca18a455bbea93f0ba1dbdcd8a6f9947;hb=80e81e3b81b779901fd9d67f8ae030ee30c0bcec;hp=8872ba62927c822977f8d90dda37f5084f1e209a;hpb=384ef31bc01e4a1a2e59d082c9066002410ba54a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp index 8872ba629..f25cc219c 100644 --- a/src/modules/m_namedmodes.cpp +++ b/src/modules/m_namedmodes.cpp @@ -1,6 +1,11 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2017 B00mX0r + * Copyright (C) 2013-2016 Attila Molnar + * Copyright (C) 2013, 2017-2019 Sadie Powell + * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009-2010 Daniel De Graaf * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -38,10 +43,11 @@ static void DisplayList(LocalUser* user, Channel* channel) if (!channel->IsModeSet(mh)) continue; numeric.Add("+" + mh->name); - if (mh->NeedsParam(true)) + ParamModeBase* pm = mh->IsParameterMode(); + if (pm) { - if ((mh->name == "key") && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex"))) - numeric.Add(""); + if ((pm->IsParameterSecret()) && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex"))) + numeric.Add("<" + mh->name + ">"); else numeric.Add(channel->GetModeParameter(mh)); } @@ -56,7 +62,7 @@ class CommandProp : public SplitCommand CommandProp(Module* parent) : SplitCommand(parent, "PROP", 1) { - syntax = " {[+-] []}*"; + syntax = " [[(+|-)] []]"; } CmdResult HandleLocal(LocalUser* src, const Params& parameters) CXX11_OVERRIDE @@ -112,8 +118,9 @@ class DummyZ : public ModeHandler // Handle /MODE #chan Z void DisplayList(User* user, Channel* chan) CXX11_OVERRIDE { - if (IS_LOCAL(user)) - ::DisplayList(static_cast(user), chan); + LocalUser* luser = IS_LOCAL(user); + if (luser) + ::DisplayList(luser, chan); } }; @@ -128,7 +135,7 @@ class ModuleNamedModes : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides the ability to manipulate modes via long names.",VF_VENDOR); + return Version("Provides support for adding and removing modes via their long names.", VF_VENDOR); } void Prioritize() CXX11_OVERRIDE