Browse Source

A labeled command that has 0 response lines should receive an empty batch

See discussion on #391.
tags/v1.0.0
Shivaram Lingamneni 5 years ago
parent
commit
bbd99b655a
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      irc/responsebuffer.go

+ 2
- 2
irc/responsebuffer.go View File

@@ -142,10 +142,10 @@ func (rb *ResponseBuffer) flushInternal(final bool, blocking bool) error {
142 142
 	}
143 143
 
144 144
 	useLabel := rb.target.capabilities.Has(caps.LabeledResponse) && rb.Label != ""
145
-	// use a batch if we have a label, and we either currently have multiple messages,
145
+	// use a batch if we have a label, and we either currently have 0 or 2+ messages,
146 146
 	// or we are doing a Flush() and we have to assume that there will be more messages
147 147
 	// in the future.
148
-	useBatch := useLabel && (len(rb.messages) > 1 || !final)
148
+	useBatch := useLabel && (len(rb.messages) != 1 || !final)
149 149
 
150 150
 	// if label but no batch, add label to first message
151 151
 	if useLabel && !useBatch && len(rb.messages) == 1 && rb.batchID == "" {

Loading…
Cancel
Save