diff --git a/downstream.go b/downstream.go index f5bc48c..4e84323 100644 --- a/downstream.go +++ b/downstream.go @@ -1004,7 +1004,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { sendNames(dc, ch) } else { // NAMES on a channel we have not joined, ask upstream - uc.SendMessage(&irc.Message{ + uc.SendMessageLabeled(dc, &irc.Message{ Command: "NAMES", Params: []string{upstreamChannel}, }) @@ -1051,7 +1051,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { params = []string{upstreamName} } - uc.SendMessage(&irc.Message{ + uc.SendMessageLabeled(dc, &irc.Message{ Command: "WHO", Params: params, }) @@ -1108,7 +1108,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { params = []string{upstreamNick} } - uc.SendMessage(&irc.Message{ + uc.SendMessageLabeled(dc, &irc.Message{ Command: "WHOIS", Params: params, }) diff --git a/upstream.go b/upstream.go index 49ccbaf..95e0def 100644 --- a/upstream.go +++ b/upstream.go @@ -750,7 +750,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { ch, ok := uc.channels[name] if !ok { // NAMES on a channel we have not joined, forward to downstream - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { channel := dc.marshalChannel(uc, name) members := strings.Split(members, " ") for i, member := range members { @@ -787,7 +787,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { ch, ok := uc.channels[name] if !ok { // NAMES on a channel we have not joined, forward to downstream - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { channel := dc.marshalChannel(uc, name) dc.SendMessage(&irc.Message{ @@ -826,7 +826,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { trailing = strconv.Itoa(hops) + " " + realname - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { channel := channel if channel != "*" { channel = dc.marshalChannel(uc, channel) @@ -844,7 +844,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { return err } - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { name := name if name != "*" { // TODO: support WHO masks @@ -862,7 +862,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { return err } - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { nick := dc.marshalNick(uc, nick) dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), @@ -876,7 +876,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { return err } - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { nick := dc.marshalNick(uc, nick) dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), @@ -890,7 +890,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { return err } - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { nick := dc.marshalNick(uc, nick) dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), @@ -904,7 +904,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { return err } - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { nick := dc.marshalNick(uc, nick) params := []string{dc.nick, nick} params = append(params, msg.Params[2:]...) @@ -921,7 +921,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { } channels := strings.Split(channelList, " ") - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { nick := dc.marshalNick(uc, nick) channelList := make([]string, len(channels)) for i, channel := range channels { @@ -942,7 +942,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { return err } - uc.forEachDownstream(func(dc *downstreamConn) { + uc.forEachDownstreamById(downstreamId, func(dc *downstreamConn) { nick := dc.marshalNick(uc, nick) dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(),