|
@@ -75,6 +75,11 @@ func (rb *ResponseBuffer) AddSplitMessageFromClient(msgid string, from *Client,
|
75
|
75
|
|
76
|
76
|
// Send sends the message to our target client.
|
77
|
77
|
func (rb *ResponseBuffer) Send() error {
|
|
78
|
+ // fall out if no messages to send
|
|
79
|
+ if len(rb.messages) == 0 {
|
|
80
|
+ return
|
|
81
|
+ }
|
|
82
|
+
|
78
|
83
|
// make batch and all if required
|
79
|
84
|
var batch *Batch
|
80
|
85
|
useLabel := rb.target.capabilities.Has(caps.LabeledResponse) && rb.Label != ""
|
|
@@ -116,5 +121,8 @@ func (rb *ResponseBuffer) Send() error {
|
116
|
121
|
batch.End(rb.target)
|
117
|
122
|
}
|
118
|
123
|
|
|
124
|
+ // clear out any existing messages
|
|
125
|
+ rb.messages = []ircmsg.IrcMessage{}
|
|
126
|
+
|
119
|
127
|
return nil
|
120
|
128
|
}
|