From 026c579e4cac7d4545b3c8c3a0d690c8509dc713 Mon Sep 17 00:00:00 2001 From: B00mX0r Date: Tue, 19 Dec 2017 14:15:30 -0800 Subject: Fixed misc. instances of ERR_NOSUCHNICK instead of channel numerics Per #1122 --- src/modules/m_cycle.cpp | 2 +- src/modules/m_knock.cpp | 2 +- src/modules/m_namedmodes.cpp | 2 +- src/modules/m_redirect.cpp | 2 +- src/modules/m_remove.cpp | 9 +++++++-- src/modules/m_satopic.cpp | 2 +- src/modules/m_timedbans.cpp | 2 +- src/modules/m_uninvite.cpp | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index 68463a4e7..1028fa977 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -44,7 +44,7 @@ class CommandCycle : public SplitCommand if (!channel) { - user->WriteNumeric(ERR_NOSUCHCHANNEL, parameters[0], "No such channel"); + user->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); return CMD_FAILURE; } diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 48ed3c06f..8be05fd53 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -45,7 +45,7 @@ class CommandKnock : public Command Channel* c = ServerInstance->FindChan(parameters[0]); if (!c) { - user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); + user->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); return CMD_FAILURE; } diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp index cd63f4298..5c280b355 100644 --- a/src/modules/m_namedmodes.cpp +++ b/src/modules/m_namedmodes.cpp @@ -57,7 +57,7 @@ class CommandProp : public SplitCommand Channel* const chan = ServerInstance->FindChan(parameters[0]); if (!chan) { - src->WriteNumeric(Numerics::NoSuchNick(parameters[0])); + src->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); return CMD_FAILURE; } diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index b3dc6e94d..b71a2f3db 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -38,7 +38,7 @@ class Redirect : public ParamMode { if (!ServerInstance->IsChannel(parameter)) { - source->WriteNumeric(ERR_NOSUCHCHANNEL, parameter, "Invalid channel name"); + source->WriteNumeric(Numerics::NoSuchChannel(parameter)); return MODEACTION_DENY; } } diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index dfe624702..0d816cc41 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -74,9 +74,14 @@ class RemoveBase : public Command channel = ServerInstance->FindChan(channame); /* Fix by brain - someone needs to learn to validate their input! */ - if ((!target) || (target->registered != REG_ALL) || (!channel)) + if (!channel) { - user->WriteNumeric(Numerics::NoSuchNick(channel ? username.c_str() : channame.c_str())); + user->WriteNumeric(Numerics::NoSuchChannel(channame)); + return CMD_FAILURE; + } + if ((!target) || (target->registered != REG_ALL)) + { + user->WriteNumeric(Numerics::NoSuchNick(username)); return CMD_FAILURE; } diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index 56fa528f4..8fe96bcf9 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -52,7 +52,7 @@ class CommandSATopic : public Command } else { - user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); + user->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); return CMD_FAILURE; } } diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 14ef11107..2decc2d3a 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -73,7 +73,7 @@ class CommandTban : public Command Channel* channel = ServerInstance->FindChan(parameters[0]); if (!channel) { - user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); + user->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); return CMD_FAILURE; } unsigned int cm = channel->GetPrefixValue(user); diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index df43e2bb2..25c98e77c 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -51,7 +51,7 @@ class CommandUninvite : public Command { if (!c) { - user->WriteNumeric(Numerics::NoSuchNick(parameters[1])); + user->WriteNumeric(Numerics::NoSuchChannel(parameters[1])); } else { -- cgit v1.2.3