// Check that the mode actually exists.
ModeHandler* mh = ServerInstance->Modes->FindMode(chr, type);
- if (!chr)
+ if (!mh)
throw ModuleException(InspIRCd::Format("Nonexistent mode '%c' was specified in <disabled:%s> at %s",
chr, field.c_str(), tag->getTagLocation().c_str()));
{
// The server administrator has specified that disabled modes should be
// treated as if they do not exist.
- user->WriteNumeric(mh->GetModeType() == MODETYPE_CHANNEL ? ERR_UNKNOWNMODE : ERR_UNKNOWNSNOMASK,
- mh->GetModeChar(), "is an unknown mode character");
+ int numeric = (mh->GetModeType() == MODETYPE_CHANNEL ? ERR_UNKNOWNMODE : ERR_UNKNOWNSNOMASK);
+ const char* typestr = (mh->GetModeType() == MODETYPE_CHANNEL ? "channel" : "user");
+ user->WriteNumeric(numeric, mh->GetModeChar(), InspIRCd::Format("is not a recognised %s mode.", typestr));
return MOD_RES_DENY;
}