From b78d8be49088b51d5ee6be992b683af299a6a1b6 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 5 Aug 2022 19:16:40 +0200 Subject: [PATCH] upstream: remove heuristic to marshal nick in errors --- upstream.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/upstream.go b/upstream.go index 09fd28f..6a3db92 100644 --- a/upstream.go +++ b/upstream.go @@ -1614,20 +1614,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err uc.logger.Printf("unhandled message: %v", msg) uc.forEachDownstreamByID(downstreamID, func(dc *downstreamConn) { - // best effort marshaling for unknown messages, replies and errors: - // most numerics start with the user nick, marshal it if that's the case - // otherwise, conservately keep the params without marshaling - params := msg.Params - if _, err := strconv.Atoi(msg.Command); err == nil { // numeric - if len(msg.Params) > 0 && isOurNick(uc.network, msg.Params[0]) { - params[0] = dc.nick - } - } - dc.SendMessage(&irc.Message{ - Prefix: uc.srv.prefix(), - Command: msg.Command, - Params: params, - }) + dc.SendMessage(msg) }) } return nil