1
0
Fork 0
forked from External/ergo

(hopefully) fix labeled-response behaviour

This commit is contained in:
Daniel Oaks 2018-02-11 08:57:15 +10:00
parent e0fa97d344
commit a70cc6713c
4 changed files with 43 additions and 33 deletions

View file

@ -23,7 +23,7 @@ type ResponseBuffer struct {
// GetLabel returns the label from the given message.
func GetLabel(msg ircmsg.IrcMessage) string {
return msg.Tags["label"].Value
return msg.Tags[caps.LabelTagName].Value
}
// NewResponseBuffer returns a new ResponseBuffer.
@ -90,13 +90,13 @@ func (rb *ResponseBuffer) Send() error {
// if label but no batch, add label to first message
if useLabel && batch == nil {
message := rb.messages[0]
message.Tags["label"] = ircmsg.MakeTagValue(rb.Label)
message.Tags[caps.LabelTagName] = ircmsg.MakeTagValue(rb.Label)
rb.messages[0] = message
}
// start batch if required
if batch != nil {
batch.Start(rb.target, ircmsg.MakeTags("label", rb.Label))
batch.Start(rb.target, ircmsg.MakeTags(caps.LabelTagName, rb.Label))
}
// send each message out