- std::string dummy;
- if (mh->AccessCheck(source, channel, dummy, true) == MOD_RES_DENY)
- return MOD_RES_DENY;
- if (mh->GetLevelRequired() > mylevel)
- return MOD_RES_DENY;
+ std::string dummy;
+ if (mh->AccessCheck(source, channel, dummy, true) == MOD_RES_DENY)
+ return MOD_RES_DENY;
+ if (mh->GetLevelRequired(adding) > mylevel)
+ {
+ source->WriteNumeric(ERR_CHANOPRIVSNEEDED, channel->name, InspIRCd::Format("You must be able to %s mode %c (%s) to %s an autoop containing it",
+ adding ? "set" : "unset", mh->GetModeChar(), mh->name.c_str(), adding ? "add" : "remove"));
+ return MOD_RES_DENY;