diff --git a/irc/handlers.go b/irc/handlers.go index b256bb80..0c54a02c 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,