diff options
| author | 2022-04-12 12:48:54 +0100 | |
|---|---|---|
| committer | 2022-04-12 12:48:54 +0100 | |
| commit | 7266f8681d603c58e1281f3e7e2934d61f910ea4 (patch) | |
| tree | f836b95102576150c0deb52529d77eb3dfa0de0f /src/mode.cpp | |
| parent | Use ERR_RESTRICTED when an action can't be done even with privileges. (diff) | |
Add a numeric builder for the ERR_CHANOPRIVSNEEDED numeric.
This should make privilege errors more consistent.
Diffstat (limited to 'src/mode.cpp')
| -rw-r--r-- | src/mode.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 8fdbcdea0..7ac165bf4 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -286,12 +286,8 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, Mode unsigned int ourrank = chan->GetPrefixValue(user); if (ourrank < neededrank) { - const PrefixMode* neededmh = FindNearestPrefixMode(neededrank); - if (neededmh) - user->WriteNumeric(ERR_CHANOPRIVSNEEDED, chan->name, InspIRCd::Format("You must have channel %s access or above to %sset channel mode %c", - neededmh->name.c_str(), adding ? "" : "un", modechar)); - else - user->WriteNumeric(ERR_CHANOPRIVSNEEDED, chan->name, InspIRCd::Format("You cannot %sset channel mode %c", (adding ? "" : "un"), modechar)); + user->WriteNumeric(Numerics::ChannelPrivilegesNeeded(chan, neededrank, InspIRCd::Format("%s channel mode %c (%s)", + adding ? "set" : "unset", mh->GetModeChar(), mh->name.c_str()))); return MODEACTION_DENY; } } |
