Send ERR_NOSUCHCHANNEL on TOPIC for non-existent channel (non-strict)

This commit is contained in:
Les De Ridder 2020-10-14 06:52:42 +02:00
parent 21368785d6
commit a59fdc67ce
1 changed files with 10 additions and 4 deletions

View File

@ -657,11 +657,17 @@ class Connection
&& (!(c.modes.canFind('s') || c.modes.canFind('p')) || c.members.canFind(this)))) && (!(c.modes.canFind('s') || c.modes.canFind('p')) || c.members.canFind(this))))
{ {
//NOTE: The RFCs don't allow ERR_NOSUCHCHANNEL as a response to TOPIC //NOTE: The RFCs don't allow ERR_NOSUCHCHANNEL as a response to TOPIC
//TODO: If RFC-strictness is off, do send ERR_NOSUCHCHANNEL version (BasicFixes)
{
sendErrNoSuchChannel(channelName);
}
else
{
send(Message(_server.name, "331", [ send(Message(_server.name, "331", [
nick, channelName, "No topic is set" nick, channelName, "No topic is set"
], true)); ], true));
} }
}
else else
{ {
_server.sendChannelTopic(this, channelName); _server.sendChannelTopic(this, channelName);