From 179991036cdc325453657515a72566e40f7d8f2b Mon Sep 17 00:00:00 2001 From: delthas Date: Mon, 15 Nov 2021 17:38:38 +0100 Subject: [PATCH] Send the downstream host for PRIVMSG echo messages If a downstream of prefix host `foo` sends a message, the other downstream of prefix host `bar` should receive an echo PRIVMSG with prefix host bar. This fixes a regression where no prefix host was sent at all. --- downstream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/downstream.go b/downstream.go index 8389767..16e8413 100644 --- a/downstream.go +++ b/downstream.go @@ -581,13 +581,13 @@ func (dc *downstreamConn) handlePong(token string) { // messages that may appear in logs are supported, except MODE messages which // may only appear in single-upstream mode. func (dc *downstreamConn) marshalMessage(msg *irc.Message, net *network) *irc.Message { + msg = msg.Copy() + msg.Prefix = dc.marshalUserPrefix(net, msg.Prefix) + if dc.network != nil { return msg } - msg = msg.Copy() - msg.Prefix = dc.marshalUserPrefix(net, msg.Prefix) - switch msg.Command { case "PRIVMSG", "NOTICE", "TAGMSG": msg.Params[0] = dc.marshalEntity(net, msg.Params[0])