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.
This commit is contained in:
parent
5defd29509
commit
8e4c8f7e5a
@ -563,6 +563,7 @@ func (dc *downstreamConn) SendMessage(msg *irc.Message) {
|
|||||||
delete(msg.Tags, "batch")
|
delete(msg.Tags, "batch")
|
||||||
}
|
}
|
||||||
if msg.Command == "JOIN" && !dc.caps.IsEnabled("extended-join") {
|
if msg.Command == "JOIN" && !dc.caps.IsEnabled("extended-join") {
|
||||||
|
msg = msg.Copy()
|
||||||
msg.Params = msg.Params[:1]
|
msg.Params = msg.Params[:1]
|
||||||
}
|
}
|
||||||
if msg.Command == "SETNAME" && !dc.caps.IsEnabled("setname") {
|
if msg.Command == "SETNAME" && !dc.caps.IsEnabled("setname") {
|
||||||
|
Loading…
Reference in New Issue
Block a user