3
0
mirror of https://github.com/ergochat/ergo.git synced 2025-02-01 23:24:09 +01:00
CHATHISTORY TARGETS response should not be in a batch unless the client has
explicitly requested the batch cap.
This commit is contained in:
Shivaram Lingamneni 2023-05-29 22:22:01 -04:00
parent bf33fba33a
commit 00cfe98461

View File

@ -655,8 +655,10 @@ func chathistoryHandler(server *Server, client *Client, msg ircmsg.Message, rb *
} else { } else {
// successful responses are sent as a chathistory or history batch // successful responses are sent as a chathistory or history batch
if listTargets { if listTargets {
batchID := rb.StartNestedBatch("draft/chathistory-targets") if rb.session.capabilities.Has(caps.Batch) { // #2066
defer rb.EndNestedBatch(batchID) batchID := rb.StartNestedBatch("draft/chathistory-targets")
defer rb.EndNestedBatch(batchID)
}
for _, target := range targets { for _, target := range targets {
name := server.UnfoldName(target.CfName) name := server.UnfoldName(target.CfName)
rb.Add(nil, server.name, "CHATHISTORY", "TARGETS", name, rb.Add(nil, server.name, "CHATHISTORY", "TARGETS", name,