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

Merge pull request #1454 from slingamn/maxlinelen_caps

make CAP LS/LIST respect the MaxLineLen constant
This commit is contained in:
Shivaram Lingamneni 2020-12-13 20:05:40 -05:00 committed by GitHub
commit 5e03c560d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -476,7 +476,7 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Respo
// so try as hard as possible to get the response to fit on one line.
// :server.name CAP * LS * :<tokens>
// 1 7 4
maxLen := 510 - 1 - len(server.name) - 7 - len(subCommand) - 4
maxLen := (MaxLineLen - 2) - 1 - len(server.name) - 7 - len(subCommand) - 4
capLines := cset.Strings(version, values, maxLen)
for i, capStr := range capLines {
if version >= caps.Cap302 && i < len(capLines)-1 {