diff --git a/downstream.go b/downstream.go index 006a14f..8ed0826 100644 --- a/downstream.go +++ b/downstream.go @@ -1099,7 +1099,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { sendNames(dc, ch) } else { // NAMES on a channel we have not joined, ask upstream - uc.SendMessageLabeled(dc, &irc.Message{ + uc.SendMessageLabeled(dc.id, &irc.Message{ Command: "NAMES", Params: []string{upstreamChannel}, }) @@ -1146,7 +1146,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { params = []string{upstreamName} } - uc.SendMessageLabeled(dc, &irc.Message{ + uc.SendMessageLabeled(dc.id, &irc.Message{ Command: "WHO", Params: params, }) @@ -1203,7 +1203,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { params = []string{upstreamNick} } - uc.SendMessageLabeled(dc, &irc.Message{ + uc.SendMessageLabeled(dc.id, &irc.Message{ Command: "WHOIS", Params: params, }) @@ -1288,7 +1288,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { } uc := ucChannel - uc.SendMessageLabeled(dc, &irc.Message{ + uc.SendMessageLabeled(dc.id, &irc.Message{ Command: "INVITE", Params: []string{upstreamUser, upstreamChannel}, }) diff --git a/upstream.go b/upstream.go index c6e34bc..fcc2be7 100644 --- a/upstream.go +++ b/upstream.go @@ -1227,12 +1227,12 @@ func (uc *upstreamConn) SendMessage(msg *irc.Message) { uc.outgoing <- msg } -func (uc *upstreamConn) SendMessageLabeled(dc *downstreamConn, msg *irc.Message) { +func (uc *upstreamConn) SendMessageLabeled(downstreamID uint64, msg *irc.Message) { if uc.labelsSupported { if msg.Tags == nil { msg.Tags = make(map[string]irc.TagValue) } - msg.Tags["label"] = irc.TagValue(fmt.Sprintf("sd-%d-%d", dc.id, uc.nextLabelID)) + msg.Tags["label"] = irc.TagValue(fmt.Sprintf("sd-%d-%d", downstreamID, uc.nextLabelID)) uc.nextLabelID++ } uc.SendMessage(msg)