Pass-through NICK messages for other users

This commit is contained in:
Simon Ser 2020-03-06 18:42:55 +01:00
parent 660e4c035d
commit 7883e8fa23
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -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")