xirc: drop CaseMappingNone

Servers can't actually use this, so it's not very useful.
This commit is contained in:
Simon Ser 2023-03-01 13:58:01 +01:00
parent ebd101820b
commit 7b41b0302d
2 changed files with 3 additions and 8 deletions

View File

@ -157,9 +157,9 @@ type network struct {
func newNetwork(user *user, record *database.Network, channels []database.Channel) *network { func newNetwork(user *user, record *database.Network, channels []database.Channel) *network {
logger := &prefixLogger{user.logger, fmt.Sprintf("network %q: ", record.GetName())} logger := &prefixLogger{user.logger, fmt.Sprintf("network %q: ", record.GetName())}
// Initialize maps with the no-op case-mapping to avoid collisions: we // Initialize maps with the most strict case-mapping to avoid collisions:
// don't know which case-mapping will be used by the upstream server yet // we don't know which case-mapping will be used by the upstream server yet
cm := xirc.CaseMappingNone cm := xirc.CaseMappingASCII
m := xirc.NewCaseMappingMap[*database.Channel](cm) m := xirc.NewCaseMappingMap[*database.Channel](cm)
for _, ch := range channels { for _, ch := range channels {

View File

@ -1,9 +1,5 @@
package xirc package xirc
func casemapNone(name string) string {
return name
}
// CasemapASCII of name is the canonical representation of name according to the // CasemapASCII of name is the canonical representation of name according to the
// ascii casemapping. // ascii casemapping.
func casemapASCII(name string) string { func casemapASCII(name string) string {
@ -57,7 +53,6 @@ func casemapRFC1459Strict(name string) string {
type CaseMapping func(string) string type CaseMapping func(string) string
var ( var (
CaseMappingNone CaseMapping = casemapNone
CaseMappingASCII CaseMapping = casemapASCII CaseMappingASCII CaseMapping = casemapASCII
CaseMappingRFC1459 CaseMapping = casemapRFC1459 CaseMappingRFC1459 CaseMapping = casemapRFC1459
CaseMappingRFC1459Strict CaseMapping = casemapRFC1459Strict CaseMappingRFC1459Strict CaseMapping = casemapRFC1459Strict