use the new irc-go identifiers

This commit is contained in:
Shivaram Lingamneni 2021-03-10 20:07:43 -05:00
parent 896ed91d45
commit 131eb229bc
9 changed files with 89 additions and 89 deletions

View file

@ -36,14 +36,14 @@ type ResponseBuffer struct {
// nested batch.)
nestedBatches []string
messages []ircmsg.IRCMessage
messages []ircmsg.Message
finalized bool
target *Client
session *Session
}
// GetLabel returns the label from the given message.
func GetLabel(msg ircmsg.IRCMessage) string {
func GetLabel(msg ircmsg.Message) string {
_, value := msg.GetTag(caps.LabelTagName)
return value
}
@ -57,7 +57,7 @@ func NewResponseBuffer(session *Session) *ResponseBuffer {
}
}
func (rb *ResponseBuffer) AddMessage(msg ircmsg.IRCMessage) {
func (rb *ResponseBuffer) AddMessage(msg ircmsg.Message) {
if rb.finalized {
rb.target.server.logger.Error("internal", "message added to finalized ResponseBuffer, undefined behavior")
debug.PrintStack()
@ -72,7 +72,7 @@ func (rb *ResponseBuffer) AddMessage(msg ircmsg.IRCMessage) {
rb.messages = append(rb.messages, msg)
}
func (rb *ResponseBuffer) setNestedBatchTag(msg *ircmsg.IRCMessage) {
func (rb *ResponseBuffer) setNestedBatchTag(msg *ircmsg.Message) {
if 0 < len(rb.nestedBatches) {
msg.SetTag("batch", rb.nestedBatches[len(rb.nestedBatches)-1])
}
@ -86,7 +86,7 @@ func (rb *ResponseBuffer) Add(tags map[string]string, prefix string, command str
// Broadcast adds a standard new message to our queue, then sends an unlabeled copy
// to all other sessions.
func (rb *ResponseBuffer) Broadcast(tags map[string]string, prefix string, command string, params ...string) {
// can't reuse the IRCMessage object because of tag pollution :-\
// can't reuse the Message object because of tag pollution :-\
rb.Add(tags, prefix, command, params...)
for _, session := range rb.session.client.Sessions() {
if session != rb.session {