void ModeHandler::OnParameterMissing(User* user, User* dest, Channel* channel)
{
+ const std::string message = InspIRCd::Format("You must specify a parameter for the %s mode", name.c_str());
+ if (channel)
+ user->WriteNumeric(Numerics::InvalidModeParameter(channel, this, "*", message));
+ else
+ user->WriteNumeric(Numerics::InvalidModeParameter(dest, this, "*", message));
}
bool ModeHandler::ResolveModeConflict(std::string& theirs, const std::string& ours, Channel*)
Modes::Change& item = *i;
ModeHandler* mh = item.mh;
+ // If a mode change has been given for a mode that does not exist then reject
+ // it. This can happen when core_reloadmodule attempts to restore a mode that
+ // no longer exists.
+ if (!mh)
+ continue;
+
// If the mode is supposed to have a parameter then we first take a look at item.param
// and, if we were asked to, also handle mode merges now
if (mh->NeedsParam(item.adding))