From 128aefcc50fe77a60512dad39f3281d553879d2e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 21 Mar 2022 17:16:02 +0100 Subject: [PATCH] downstream: strip back "*" prefix --- downstream.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/downstream.go b/downstream.go index 38a368e..c82f7e8 100644 --- a/downstream.go +++ b/downstream.go @@ -581,6 +581,11 @@ func (dc *downstreamConn) SendMessage(msg *irc.Message) { if msg.Command == "READ" && !dc.caps.IsEnabled("soju.im/read") { return } + if msg.Prefix != nil && msg.Prefix.Name == "*" { + // We use "*" as a sentinel value to simplify upstream message handling + msg = msg.Copy() + msg.Prefix = nil + } dc.srv.metrics.downstreamOutMessagesTotal.Inc() dc.conn.SendMessage(context.TODO(), msg)