From 0714466af88d71d6c395629cd7fb624b099507d4 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 3 Sep 2023 10:05:54 +0200 Subject: [PATCH] Return ERR_NOTEXTTOSEND on empty PRIVMSG content They are dropped further down the line anyway; and sending ERR_NOTEXTTOSEND early matches other servers' behavior. --- src/ngircd/irc.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.39.2