3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 03:49:27 +01:00

Merge pull request #1766 from slingamn/allow_truncation

fix incorrect handling of overlong lines when allow-truncation is enabled
This commit is contained in:
Shivaram Lingamneni 2021-08-03 00:40:54 -04:00 committed by GitHub
commit 1389d89a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -711,9 +711,11 @@ func (client *Client) run(session *Session) {
} else if err == ircmsg.ErrorTagsTooLong {
session.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line contained excess tag data"))
continue
} else if err == ircmsg.ErrorBodyTooLong && !client.server.Config().Server.Compatibility.allowTruncation {
} else if err == ircmsg.ErrorBodyTooLong {
if !client.server.Config().Server.Compatibility.allowTruncation {
session.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line too long"))
continue
} // else: proceed with the truncated line
} else if err != nil {
client.Quit(client.t("Received malformed line"), session)
break