/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2019-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2019 Robby <robby@chatbelgie.be>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
// 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()));
throw ModuleException(InspIRCd::Format("Nonexistent command '%s' was specified in <disabled:commands> at %s",
command.c_str(), tag->getTagLocation().c_str()));
- // Prevent admins from disabling COMMANDS and MODULES for transparency reasons.
- if (handler->name == "COMMANDS" || handler->name == "MODULES")
+ // Prevent admins from disabling MODULES for transparency reasons.
+ if (handler->name == "MODULES")
continue;
// Disable the command.