X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommand_parse.cpp;h=533c7e28150c942321e45676366cbdd95f208126;hb=168ee804903e5ee10edc04e870e36a1256885e34;hp=503630d537eaa5f0b409fcd73c76922237a94587;hpb=b2ac8cc0a6405946a388b80df3be21bc276a61f3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 503630d53..533c7e281 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -97,10 +97,10 @@ bool CommandParser::LoopCall(User* user, Command* handler, const CommandBase::Pa CmdResult result = handler->Handle(user, params); if (localuser) { - // Run the OnPostCommand hook with the last parameter (original line) being empty - // to indicate that the command had more targets in its original form. + // Run the OnPostCommand hook with the last parameter being true to indicate + // that the event is being called in a loop. item.clear(); - FOREACH_MOD(OnPostCommand, (handler, new_parameters, localuser, result)); + FOREACH_MOD(OnPostCommand, (handler, new_parameters, localuser, result, true)); } } } @@ -246,7 +246,7 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman return; /* activity resets the ping pending timer */ - user->nping = ServerInstance->Time() + user->MyClass->GetPingTime(); + user->nextping = ServerInstance->Time() + user->MyClass->GetPingTime(); if (handler->flags_needed) { @@ -266,24 +266,6 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman } } - if ((user->registered == REG_ALL) && (!user->IsOper()) && (handler->IsDisabled())) - { - /* command is disabled! */ - user->CommandFloodPenalty += failpenalty; - if (ServerInstance->Config->DisabledDontExist) - { - user->WriteNumeric(ERR_UNKNOWNCOMMAND, command, "Unknown command"); - } - else - { - user->WriteNumeric(ERR_UNKNOWNCOMMAND, command, "This command has been disabled."); - } - - ServerInstance->SNO->WriteToSnoMask('a', "%s denied for %s (%s@%s)", - command.c_str(), user->nick.c_str(), user->ident.c_str(), user->GetRealHost().c_str()); - return; - } - if ((!command_p.empty()) && (command_p.back().empty()) && (!handler->allow_empty_last_param)) command_p.pop_back(); @@ -316,7 +298,7 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman */ CmdResult result = handler->Handle(user, command_p); - FOREACH_MOD(OnPostCommand, (handler, command_p, user, result)); + FOREACH_MOD(OnPostCommand, (handler, command_p, user, result, false)); } } @@ -333,7 +315,6 @@ CommandBase::CommandBase(Module* mod, const std::string& cmd, unsigned int minpa , min_params(minpara) , max_params(maxpara) , use_count(0) - , disabled(false) , works_before_reg(false) , allow_empty_last_param(true) , Penalty(1) @@ -452,7 +433,7 @@ void CommandParser::TranslateSingleParam(TranslateType to, const std::string& it } // If no custom translator was given, fall through } - case TR_TEXT: + /*@fallthrough@*/ default: /* Do nothing */ dest.append(item);