From 637b989a474749f3da8c61d59fb3b6e86ae69136 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 1 Mar 2023 12:55:10 +0100 Subject: [PATCH] Add downstreamConn.updateCasemapping() We weren't correctly updating nickCM. --- downstream.go | 11 +++++++++++ user.go | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/downstream.go b/downstream.go index 3fb851c..d96aebd 100644 --- a/downstream.go +++ b/downstream.go @@ -1195,6 +1195,16 @@ func (dc *downstreamConn) updateAccount() { dc.account = account } +func (dc *downstreamConn) updateCasemapping() { + cm := casemapASCII + if dc.network != nil { + cm = dc.network.casemap + } + + dc.nickCM = cm(dc.nick) + dc.monitored.SetCasemapping(cm) +} + func sanityCheckServer(ctx context.Context, addr string) error { ctx, cancel := context.WithTimeout(ctx, 15*time.Second) defer cancel() @@ -1511,6 +1521,7 @@ func (dc *downstreamConn) welcome(ctx context.Context) error { dc.updateHost() dc.updateRealname() dc.updateAccount() + dc.updateCasemapping() if motd := dc.user.srv.Config().MOTD; motd != "" && dc.network == nil { for _, msg := range xirc.GenerateMOTD(dc.srv.prefix(), dc.nick, motd) { diff --git a/user.go b/user.go index 8d832cf..0e434aa 100644 --- a/user.go +++ b/user.go @@ -401,7 +401,7 @@ func (net *network) updateCasemapping(newCasemap casemapping) { uc.monitored.SetCasemapping(newCasemap) } net.forEachDownstream(func(dc *downstreamConn) { - dc.monitored.SetCasemapping(newCasemap) + dc.updateCasemapping() }) } @@ -632,6 +632,7 @@ func (u *user) run() { dc.updateHost() dc.updateRealname() dc.updateAccount() + dc.updateCasemapping() }) u.notifyBouncerNetworkState(uc.network.ID, irc.Tags{ "state": "connected",