summaryrefslogtreecommitdiff
path: root/src/coremods
diff options
context:
space:
mode:
authorB00mX0r <b00mx0r@aureus.pw>2017-12-19 14:15:30 -0800
committerB00mX0r <b00mx0r@aureus.pw>2017-12-22 00:35:09 -0800
commit026c579e4cac7d4545b3c8c3a0d690c8509dc713 (patch)
treed92941491ef510a9ec8ff317a9002429ae96a33e /src/coremods
parente467fd0a6fc9ba97b2e2f31e654803a86bbb307f (diff)
Fixed misc. instances of ERR_NOSUCHNICK instead of channel numerics
Per #1122
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_channel/cmd_invite.cpp9
-rw-r--r--src/coremods/core_channel/cmd_join.cpp2
-rw-r--r--src/coremods/core_channel/cmd_kick.cpp9
-rw-r--r--src/coremods/core_channel/cmd_names.cpp2
-rw-r--r--src/coremods/core_channel/cmd_topic.cpp4
-rw-r--r--src/coremods/core_privmsg.cpp4
-rw-r--r--src/coremods/core_user/cmd_mode.cpp5
-rw-r--r--src/coremods/core_user/cmd_part.cpp2
8 files changed, 25 insertions, 12 deletions
diff --git a/src/coremods/core_channel/cmd_invite.cpp b/src/coremods/core_channel/cmd_invite.cpp
index a1319ebc0..88b2cf86c 100644
--- a/src/coremods/core_channel/cmd_invite.cpp
+++ b/src/coremods/core_channel/cmd_invite.cpp
@@ -56,9 +56,14 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
timeout = ConvToInt(parameters[3]);
}
- if ((!c) || (!u) || (u->registered != REG_ALL))
+ if (!c)
{
- user->WriteNumeric(Numerics::NoSuchNick(c ? parameters[0] : parameters[1]));
+ user->WriteNumeric(Numerics::NoSuchChannel(parameters[1]));
+ return CMD_FAILURE;
+ }
+ if ((!u) || (u->registered != REG_ALL))
+ {
+ user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
return CMD_FAILURE;
}
diff --git a/src/coremods/core_channel/cmd_join.cpp b/src/coremods/core_channel/cmd_join.cpp
index 06e203ead..a60f1b2c6 100644
--- a/src/coremods/core_channel/cmd_join.cpp
+++ b/src/coremods/core_channel/cmd_join.cpp
@@ -55,6 +55,6 @@ CmdResult CommandJoin::HandleLocal(const std::vector<std::string>& parameters, L
}
}
- user->WriteNumeric(ERR_NOSUCHCHANNEL, parameters[0], "Invalid channel name");
+ user->WriteNumeric(ERR_BADCHANMASK, parameters[0], "Invalid channel name");
return CMD_FAILURE;
}
diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp
index 420ed2b83..05e279751 100644
--- a/src/coremods/core_channel/cmd_kick.cpp
+++ b/src/coremods/core_channel/cmd_kick.cpp
@@ -42,9 +42,14 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User
else
u = ServerInstance->FindNick(parameters[1]);
- if ((!u) || (!c) || (u->registered != REG_ALL))
+ if (!c)
{
- user->WriteNumeric(Numerics::NoSuchNick(c ? parameters[1] : parameters[0]));
+ user->WriteNumeric(Numerics::NoSuchChannel(parameters[0]));
+ return CMD_FAILURE;
+ }
+ if ((!u) || (u->registered != REG_ALL))
+ {
+ user->WriteNumeric(Numerics::NoSuchNick(parameters[1]));
return CMD_FAILURE;
}
diff --git a/src/coremods/core_channel/cmd_names.cpp b/src/coremods/core_channel/cmd_names.cpp
index 21fe43cca..dd2926c33 100644
--- a/src/coremods/core_channel/cmd_names.cpp
+++ b/src/coremods/core_channel/cmd_names.cpp
@@ -62,7 +62,7 @@ CmdResult CommandNames::HandleLocal(const std::vector<std::string>& parameters,
}
}
- user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
+ user->WriteNumeric(Numerics::NoSuchChannel(parameters[0]));
return CMD_FAILURE;
}
diff --git a/src/coremods/core_channel/cmd_topic.cpp b/src/coremods/core_channel/cmd_topic.cpp
index 835ac82ed..fe913225e 100644
--- a/src/coremods/core_channel/cmd_topic.cpp
+++ b/src/coremods/core_channel/cmd_topic.cpp
@@ -38,7 +38,7 @@ CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters,
Channel* c = ServerInstance->FindChan(parameters[0]);
if (!c)
{
- user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
+ user->WriteNumeric(Numerics::NoSuchChannel(parameters[0]));
return CMD_FAILURE;
}
@@ -46,7 +46,7 @@ CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters,
{
if ((c->IsModeSet(secretmode)) && (!c->HasUser(user)))
{
- user->WriteNumeric(Numerics::NoSuchNick(c->name));
+ user->WriteNumeric(Numerics::NoSuchChannel(c->name));
return CMD_FAILURE;
}
diff --git a/src/coremods/core_privmsg.cpp b/src/coremods/core_privmsg.cpp
index d19ae09b5..89c74346e 100644
--- a/src/coremods/core_privmsg.cpp
+++ b/src/coremods/core_privmsg.cpp
@@ -180,8 +180,8 @@ CmdResult MessageCommandBase::HandleMessage(const std::vector<std::string>& para
}
else
{
- /* no such nick/channel */
- user->WriteNumeric(Numerics::NoSuchNick(target));
+ /* channel does not exist */
+ user->WriteNumeric(Numerics::NoSuchChannel(parameters[0]));
return CMD_FAILURE;
}
return CMD_SUCCESS;
diff --git a/src/coremods/core_user/cmd_mode.cpp b/src/coremods/core_user/cmd_mode.cpp
index 2b2652606..ec75d6191 100644
--- a/src/coremods/core_user/cmd_mode.cpp
+++ b/src/coremods/core_user/cmd_mode.cpp
@@ -45,7 +45,10 @@ CmdResult CommandMode::Handle(const std::vector<std::string>& parameters, User*
if ((!targetchannel) && (!targetuser))
{
- user->WriteNumeric(Numerics::NoSuchNick(target));
+ if (target[0] == '#')
+ user->WriteNumeric(Numerics::NoSuchChannel(target));
+ else
+ user->WriteNumeric(Numerics::NoSuchNick(target));
return CMD_FAILURE;
}
if (parameters.size() == 1)
diff --git a/src/coremods/core_user/cmd_part.cpp b/src/coremods/core_user/cmd_part.cpp
index 4da2787d9..261d75a70 100644
--- a/src/coremods/core_user/cmd_part.cpp
+++ b/src/coremods/core_user/cmd_part.cpp
@@ -46,7 +46,7 @@ CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User
if (!c)
{
- user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
+ user->WriteNumeric(Numerics::NoSuchChannel(parameters[0]));
return CMD_FAILURE;
}