]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_names.cpp
Remove virtual User::GetClass() (but keep LocalUser::GetClass())
[user/henk/code/inspircd.git] / src / commands / cmd_names.cpp
index 1f0de91f1353bd8713e52c1866697e02e3d6db81..c74d18c236669cfb83158cd68d86729f6e625820 100644 (file)
  */
 class CommandNames : public Command
 {
+       ChanModeReference secretmode;
+
  public:
        /** Constructor for names.
         */
-       CommandNames ( Module* parent) : Command(parent,"NAMES",0,0) { syntax = "{<channel>{,<channel>}}"; }
+       CommandNames(Module* parent)
+               : Command(parent, "NAMES", 0, 0)
+               , secretmode(parent, "secret")
+       {
+               syntax = "{<channel>{,<channel>}}";
+       }
+
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
@@ -58,7 +66,7 @@ CmdResult CommandNames::Handle (const std::vector<std::string>& parameters, User
        c = ServerInstance->FindChan(parameters[0]);
        if (c)
        {
-               if ((c->IsModeSet('s')) && (!c->HasUser(user)))
+               if ((c->IsModeSet(secretmode)) && (!c->HasUser(user)))
                {
                      user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), c->name.c_str());
                      return CMD_FAILURE;