- std::string dummy;
- if (mh->AccessCheck(source, channel, dummy, true) == MOD_RES_DENY)
- return MOD_RES_DENY;
- if (mh->GetLevelRequired() > mylevel)
- {
- source->WriteNumeric(482, "%s %s :You must be able to set mode '%c' to include it in an autoop",
- source->nick.c_str(), channel->name.c_str(), parameter[pos]);
- 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;