diff options
| author | Valentin Lorentz <progval+git@progval.net> | 2023-09-03 10:05:54 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2023-09-17 22:25:40 +0200 |
| commit | 0714466af88d71d6c395629cd7fb624b099507d4 (patch) | |
| tree | 2445ec88a28dd5bad26379aedae479526ccf3a14 /src | |
| parent | 445e559dbd6447508ad870d1830fd299964f62ba (diff) | |
| download | ngircd-0714466af88d71d6c395629cd7fb624b099507d4.tar.gz ngircd-0714466af88d71d6c395629cd7fb624b099507d4.zip | |
Return ERR_NOTEXTTOSEND on empty PRIVMSG content
They are dropped further down the line anyway; and sending ERR_NOTEXTTOSEND early matches other servers' behavior.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/irc.c | 7 |
1 files changed, 7 insertions, 0 deletions
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); |