~emersion/soju

4e84b4159216a4051fd26479f7b371356448de6a — Simon Ser 10 days ago c2a5461
Send RPL_LOGGEDIN with bouncer account in multi-upstream mode
1 files changed, 13 insertions(+), 5 deletions(-)

M downstream.go
M downstream.go => downstream.go +13 -5
@@ 1038,16 1038,24 @@ func (dc *downstreamConn) updateRealname() {
}

func (dc *downstreamConn) updateAccount() {
	uc := dc.upstream()
	if uc == nil || uc.account == dc.account || !dc.caps["sasl"] {
	var account string
	if dc.network == nil {
		account = dc.user.Username
	} else if uc := dc.upstream(); uc != nil {
		account = uc.account
	} else {
		return
	}

	if dc.account == account || !dc.caps["sasl"] {
		return
	}

	if uc.account != "" {
	if account != "" {
		dc.SendMessage(&irc.Message{
			Prefix:  dc.srv.prefix(),
			Command: irc.RPL_LOGGEDIN,
			Params:  []string{dc.nick, dc.prefix().String(), uc.account, "You are logged in as " + uc.account},
			Params:  []string{dc.nick, dc.prefix().String(), account, "You are logged in as " + account},
		})
	} else {
		dc.SendMessage(&irc.Message{


@@ 1057,7 1065,7 @@ func (dc *downstreamConn) updateAccount() {
		})
	}

	dc.account = uc.account
	dc.account = account
}

func sanityCheckServer(ctx context.Context, addr string) error {