downstream: shallow copy message in SendMessage instead of deep copy

This commit is contained in:
Simon Ser 2024-04-30 14:22:15 +02:00
parent fbcda7b963
commit d5108f3994

View file

@ -526,7 +526,8 @@ func (dc *downstreamConn) SendMessage(ctx context.Context, msg *irc.Message) {
} }
if msg.Prefix != nil && msg.Prefix.Name == "*" { if msg.Prefix != nil && msg.Prefix.Name == "*" {
// We use "*" as a sentinel value to simplify upstream message handling // We use "*" as a sentinel value to simplify upstream message handling
msg = msg.Copy() msgCopy := *msg
msg = &msgCopy
msg.Prefix = nil msg.Prefix = nil
} }