mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
(hopefully) fix labeled-response behaviour
This commit is contained in:
parent
e0fa97d344
commit
a70cc6713c
4 changed files with 43 additions and 33 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue