From 00cfe98461c6780365893c22a0e5c7ad432b3918 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 29 May 2023 22:22:01 -0400 Subject: [PATCH] fix #2066 CHATHISTORY TARGETS response should not be in a batch unless the client has explicitly requested the batch cap. --- irc/handlers.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/irc/handlers.go b/irc/handlers.go index 043519de..631c9db7 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -655,8 +655,10 @@ func chathistoryHandler(server *Server, client *Client, msg ircmsg.Message, rb * } else { // successful responses are sent as a chathistory or history batch if listTargets { - batchID := rb.StartNestedBatch("draft/chathistory-targets") - defer rb.EndNestedBatch(batchID) + if rb.session.capabilities.Has(caps.Batch) { // #2066 + batchID := rb.StartNestedBatch("draft/chathistory-targets") + defer rb.EndNestedBatch(batchID) + } for _, target := range targets { name := server.UnfoldName(target.CfName) rb.Add(nil, server.name, "CHATHISTORY", "TARGETS", name,