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));
}
}
}
}
}
- 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();
*/
CmdResult result = handler->Handle(user, command_p);
- FOREACH_MOD(OnPostCommand, (handler, command_p, user, result));
+ FOREACH_MOD(OnPostCommand, (handler, command_p, user, result, false));
}
}
, min_params(minpara)
, max_params(maxpara)
, use_count(0)
- , disabled(false)
, works_before_reg(false)
, allow_empty_last_param(true)
, Penalty(1)
}
// If no custom translator was given, fall through
}
- case TR_TEXT:
+ /*@fallthrough@*/
default:
/* Do nothing */
dest.append(item);