From d1550a3cdbdd40ed5a9f80a7d41fdbd652c9abec Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 3 Mar 2020 15:33:21 +0100 Subject: [PATCH] Remove upstream prefix for outgoing MODE and PRIVMSG We shouldn't set the prefix when sending these commands. --- downstream.go | 3 --- upstream.go | 8 -------- 2 files changed, 11 deletions(-) diff --git a/downstream.go b/downstream.go index a58b381..aaf482e 100644 --- a/downstream.go +++ b/downstream.go @@ -421,7 +421,6 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { if modeStr != "" { uc.SendMessage(&irc.Message{ - Prefix: uc.prefix(), Command: "MODE", Params: []string{upstreamName, modeStr}, }) @@ -451,7 +450,6 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { if modeStr != "" { dc.user.forEachUpstream(func(uc *upstreamConn) { uc.SendMessage(&irc.Message{ - Prefix: uc.prefix(), Command: "MODE", Params: []string{uc.nick, modeStr}, }) @@ -477,7 +475,6 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { } uc.SendMessage(&irc.Message{ - Prefix: uc.prefix(), Command: "PRIVMSG", Params: []string{upstreamName, text}, }) diff --git a/upstream.go b/upstream.go index c0ece12..0ce0bcb 100644 --- a/upstream.go +++ b/upstream.go @@ -91,14 +91,6 @@ func connectToUpstream(u *user, upstream *Upstream) (*upstreamConn, error) { return uc, nil } -func (uc *upstreamConn) prefix() *irc.Prefix { - return &irc.Prefix{ - Name: uc.nick, - User: uc.upstream.Username, - // TODO: fill the host? - } -} - func (uc *upstreamConn) Close() error { if uc.closed { return fmt.Errorf("upstream connection already closed")