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.
This commit is contained in:
delthas 2021-11-15 17:38:38 +01:00 committed by Simon Ser
parent 840d142f1c
commit 179991036c
1 changed files with 3 additions and 3 deletions

View File

@ -581,13 +581,13 @@ func (dc *downstreamConn) handlePong(token string) {
// messages that may appear in logs are supported, except MODE messages which // messages that may appear in logs are supported, except MODE messages which
// may only appear in single-upstream mode. // may only appear in single-upstream mode.
func (dc *downstreamConn) marshalMessage(msg *irc.Message, net *network) *irc.Message { 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 { if dc.network != nil {
return msg return msg
} }
msg = msg.Copy()
msg.Prefix = dc.marshalUserPrefix(net, msg.Prefix)
switch msg.Command { switch msg.Command {
case "PRIVMSG", "NOTICE", "TAGMSG": case "PRIVMSG", "NOTICE", "TAGMSG":
msg.Params[0] = dc.marshalEntity(net, msg.Params[0]) msg.Params[0] = dc.marshalEntity(net, msg.Params[0])