From 7883e8fa239a1c86a96f1779fb866e3c870c5876 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 6 Mar 2020 18:42:55 +0100 Subject: [PATCH] Pass-through NICK messages for other users --- upstream.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/upstream.go b/upstream.go index 0090249..f30f706 100644 --- a/upstream.go +++ b/upstream.go @@ -206,6 +206,16 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { ch.Members[newNick] = membership } } + + if msg.Prefix.Name != uc.nick { + uc.forEachDownstream(func(dc *downstreamConn) { + dc.SendMessage(&irc.Message{ + Prefix: dc.marshalUserPrefix(uc, msg.Prefix), + Command: "NICK", + Params: []string{newNick}, + }) + }) + } case "JOIN": if msg.Prefix == nil { return fmt.Errorf("expected a prefix")