From 8e4c8f7e5a63ab2c43adfc0cda7031bed390e3ca Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 21 Mar 2022 17:13:55 +0100 Subject: [PATCH] downstream: copy message when degrading extended-join Otherwise we mutate the input argument and loops over downstream connections to send messages will be messed up. --- downstream.go | 1 + 1 file changed, 1 insertion(+) diff --git a/downstream.go b/downstream.go index 2598150..38a368e 100644 --- a/downstream.go +++ b/downstream.go @@ -563,6 +563,7 @@ func (dc *downstreamConn) SendMessage(msg *irc.Message) { delete(msg.Tags, "batch") } if msg.Command == "JOIN" && !dc.caps.IsEnabled("extended-join") { + msg = msg.Copy() msg.Params = msg.Params[:1] } if msg.Command == "SETNAME" && !dc.caps.IsEnabled("setname") {