From 6ff26e6640e17b5ff012bce2e0d40b35d118000d Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 28 Mar 2020 17:28:28 +0100 Subject: [PATCH] Remove downstreamConn.username Replace it with downstreamConn.user.Username --- downstream.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/downstream.go b/downstream.go index 9b5f1e3..4076c21 100644 --- a/downstream.go +++ b/downstream.go @@ -69,7 +69,6 @@ type downstreamConn struct { registered bool user *user nick string - username string rawUsername string networkName string clientName string @@ -124,7 +123,7 @@ func newDownstreamConn(srv *Server, netConn net.Conn, id uint64) *downstreamConn func (dc *downstreamConn) prefix() *irc.Prefix { return &irc.Prefix{ Name: dc.nick, - User: dc.username, + User: dc.user.Username, Host: dc.hostname, } } @@ -636,8 +635,7 @@ func (dc *downstreamConn) register() error { } dc.registered = true - dc.username = dc.user.Username - dc.logger.Printf("registration complete for user %q", dc.username) + dc.logger.Printf("registration complete for user %q", dc.user.Username) return nil } @@ -1171,7 +1169,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), Command: irc.RPL_WHOREPLY, - Params: []string{dc.nick, "*", dc.username, dc.hostname, dc.srv.Hostname, dc.nick, "H", "0 " + dc.realname}, + Params: []string{dc.nick, "*", dc.user.Username, dc.hostname, dc.srv.Hostname, dc.nick, "H", "0 " + dc.realname}, }) dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), @@ -1222,7 +1220,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), Command: irc.RPL_WHOISUSER, - Params: []string{dc.nick, dc.nick, dc.username, dc.hostname, "*", dc.realname}, + Params: []string{dc.nick, dc.nick, dc.user.Username, dc.hostname, "*", dc.realname}, }) dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(),