From 7b41b0302d10bb6ff9fa6e2137b6d5ffb4709f30 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 1 Mar 2023 13:58:01 +0100 Subject: [PATCH] xirc: drop CaseMappingNone Servers can't actually use this, so it's not very useful. --- user.go | 6 +++--- xirc/casemapping.go | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/user.go b/user.go index 392f788..5459aab 100644 --- a/user.go +++ b/user.go @@ -157,9 +157,9 @@ type network struct { func newNetwork(user *user, record *database.Network, channels []database.Channel) *network { logger := &prefixLogger{user.logger, fmt.Sprintf("network %q: ", record.GetName())} - // Initialize maps with the no-op case-mapping to avoid collisions: we - // don't know which case-mapping will be used by the upstream server yet - cm := xirc.CaseMappingNone + // Initialize maps with the most strict case-mapping to avoid collisions: + // we don't know which case-mapping will be used by the upstream server yet + cm := xirc.CaseMappingASCII m := xirc.NewCaseMappingMap[*database.Channel](cm) for _, ch := range channels { diff --git a/xirc/casemapping.go b/xirc/casemapping.go index 4f8c7b0..e59d898 100644 --- a/xirc/casemapping.go +++ b/xirc/casemapping.go @@ -1,9 +1,5 @@ package xirc -func casemapNone(name string) string { - return name -} - // CasemapASCII of name is the canonical representation of name according to the // ascii casemapping. func casemapASCII(name string) string { @@ -57,7 +53,6 @@ func casemapRFC1459Strict(name string) string { type CaseMapping func(string) string var ( - CaseMappingNone CaseMapping = casemapNone CaseMappingASCII CaseMapping = casemapASCII CaseMappingRFC1459 CaseMapping = casemapRFC1459 CaseMappingRFC1459Strict CaseMapping = casemapRFC1459Strict