From: Valentin Lorentz Date: Sun, 3 Sep 2023 08:05:54 +0000 (+0200) Subject: Return ERR_NOTEXTTOSEND on empty PRIVMSG content X-Git-Tag: rel-27-rc1~97 X-Git-Url: https://arthur.barton.de/gitweb/?p=ngircd.git;a=commitdiff_plain;h=0714466af88d71d6c395629cd7fb624b099507d4 Return ERR_NOTEXTTOSEND on empty PRIVMSG content They are dropped further down the line anyway; and sending ERR_NOTEXTTOSEND early matches other servers' behavior. --- diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index ba33e5ae..5cf4fe23 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -572,6 +572,13 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors) #endif message = Req->argv[1]; + if (message[0] == '\0') { + if (!SendErrors) + return CONNECTED; + return IRC_WriteErrClient(Client, ERR_NOTEXTTOSEND_MSG, + Client_ID(Client)); + } + /* handle msgtarget = msgto *("," msgto) */ currentTarget = strtok_r(currentTarget, ",", &strtok_last); ngt_UpperStr(Req->command);