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 {
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 {

View File

@ -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