X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_names.cpp;h=c74d18c236669cfb83158cd68d86729f6e625820;hb=dafa2f3031c4abc7f5506385770c4fc743669b17;hp=1f0de91f1353bd8713e52c1866697e02e3d6db81;hpb=cfa32a6561e0152ebbd7135eaec9f7c794c170b1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_names.cpp b/src/commands/cmd_names.cpp index 1f0de91f1..c74d18c23 100644 --- a/src/commands/cmd_names.cpp +++ b/src/commands/cmd_names.cpp @@ -27,10 +27,18 @@ */ class CommandNames : public Command { + ChanModeReference secretmode; + public: /** Constructor for names. */ - CommandNames ( Module* parent) : Command(parent,"NAMES",0,0) { syntax = "{{,}}"; } + CommandNames(Module* parent) + : Command(parent, "NAMES", 0, 0) + , secretmode(parent, "secret") + { + syntax = "{{,}}"; + } + /** 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& 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;