1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-12-12 01:40:27 +00:00

Return ERR_NOTEXTTOSEND on empty PRIVMSG content

They are dropped further down the line anyway; and sending ERR_NOTEXTTOSEND
early matches other servers' behavior.
This commit is contained in:
Valentin Lorentz 2023-09-03 10:05:54 +02:00 committed by Alexander Barton
parent 445e559dbd
commit 0714466af8

View File

@ -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);