From 49f8cfa3ce62275906d8d7a936b6956bf641300d Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Wed, 14 Oct 2020 06:59:14 +0200 Subject: [PATCH] Send ERR_NOSUCHNICK on MODE with invalid target (non-strict) --- source/ircd/channel.d | 1 + source/ircd/connection.d | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/ircd/channel.d b/source/ircd/channel.d index 5a1502d..5c43b3f 100644 --- a/source/ircd/channel.d +++ b/source/ircd/channel.d @@ -224,6 +224,7 @@ class Channel modes ~= mode; + //NOTE: The RFCs don't specify that the invite list should be cleared on +i version (BasicFixes) { if (mode == 'i') diff --git a/source/ircd/connection.d b/source/ircd/connection.d index dfdf2f6..d7513b2 100644 --- a/source/ircd/connection.d +++ b/source/ircd/connection.d @@ -165,6 +165,7 @@ class Connection continue; } + //NOTE: The RFCs don't specify whether commands are case-sensitive version (BasicFixes) { message.command = message.command.map!toUpper.to!string; @@ -996,7 +997,11 @@ class Connection } else { - //TODO: If RFC-strictness is off, send an error + //NOTE: The RFCs don't allow ERR_NOSUCHNICK as a reponse to MODE + version (BasicFixes) + { + sendErrNoSuchNick(target); + } } } @@ -1438,7 +1443,6 @@ class Connection void onIncorrectPassword() { //NOTE: The RFCs don't allow ERR_PASSWDMISMATCH as a response to NICK/USER - version (BasicFixes) { send(Message(_server.name, "464", [nick, "Password incorrect"], true));