Rename casemapMap.setCasemapping to setCaseMapping

This commit is contained in:
Simon Ser 2023-03-01 13:33:58 +01:00
parent 3eb2679612
commit de90648eaa
3 changed files with 12 additions and 12 deletions

View File

@ -365,7 +365,7 @@ func newDownstreamConn(srv *Server, ic ircConn, id uint64) *downstreamConn {
monitored: newCasemapMap[struct{}](),
registration: new(downstreamRegistration),
}
dc.monitored.SetCasemapping(xirc.CaseMappingASCII)
dc.monitored.SetCaseMapping(xirc.CaseMappingASCII)
if host, _, err := net.SplitHostPort(remoteAddr); err == nil {
dc.hostname = host
} else {
@ -1203,7 +1203,7 @@ func (dc *downstreamConn) updateCasemapping() {
}
dc.nickCM = cm(dc.nick)
dc.monitored.SetCasemapping(cm)
dc.monitored.SetCaseMapping(cm)
}
func sanityCheckServer(ctx context.Context, addr string) error {
@ -2652,7 +2652,7 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
uc.updateMonitor()
case "C": // clear
dc.monitored = newCasemapMap[struct{}]()
dc.monitored.SetCasemapping(uc.network.casemap)
dc.monitored.SetCaseMapping(uc.network.casemap)
uc.updateMonitor()
case "L": // list
// TODO: be less lazy and pack the list

2
irc.go
View File

@ -277,7 +277,7 @@ func (cm *casemapMap[V]) ForEach(f func(string, V)) {
}
}
func (cm *casemapMap[V]) SetCasemapping(newCasemap xirc.CaseMapping) {
func (cm *casemapMap[V]) SetCaseMapping(newCasemap xirc.CaseMapping) {
cm.casemap = newCasemap
m := make(map[string]casemapEntry[V], len(cm.m))
for _, entry := range cm.m {

16
user.go
View File

@ -389,16 +389,16 @@ func (net *network) deleteChannel(ctx context.Context, name string) error {
func (net *network) updateCasemapping(newCasemap xirc.CaseMapping) {
net.casemap = newCasemap
net.channels.SetCasemapping(newCasemap)
net.delivered.m.SetCasemapping(newCasemap)
net.pushTargets.SetCasemapping(newCasemap)
net.channels.SetCaseMapping(newCasemap)
net.delivered.m.SetCaseMapping(newCasemap)
net.pushTargets.SetCaseMapping(newCasemap)
if uc := net.conn; uc != nil {
uc.channels.SetCasemapping(newCasemap)
uc.channels.SetCaseMapping(newCasemap)
uc.channels.ForEach(func(_ string, uch *upstreamChannel) {
uch.Members.SetCasemapping(newCasemap)
uch.Members.SetCaseMapping(newCasemap)
})
uc.users.SetCasemapping(newCasemap)
uc.monitored.SetCasemapping(newCasemap)
uc.users.SetCaseMapping(newCasemap)
uc.monitored.SetCaseMapping(newCasemap)
}
net.forEachDownstream(func(dc *downstreamConn) {
dc.updateCasemapping()
@ -694,7 +694,7 @@ func (u *user) run() {
ctx := context.TODO()
if dc.network != nil {
dc.monitored.SetCasemapping(dc.network.casemap)
dc.monitored.SetCaseMapping(dc.network.casemap)
}
if !u.Enabled && u.srv.Config().EnableUsersOnAuth {