From cab192e2af0f02d8591ac0151af96e98aee7700e Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 25 Feb 2024 03:34:21 -0500 Subject: [PATCH 1/2] fix #2130 We load registered channels unconditionally; reloading them again on rehash is incorrect. This caused buggy behavior when channel registration was disabled in the config, but some registered channels were already loaded. --- irc/server.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/irc/server.go b/irc/server.go index fbf95beb..1e7915ea 100644 --- a/irc/server.go +++ b/irc/server.go @@ -702,9 +702,6 @@ func (server *Server) applyConfig(config *Config) (err error) { if !oldConfig.Accounts.NickReservation.Enabled { server.accounts.buildNickToAccountIndex(config) } - if !oldConfig.Channels.Registration.Enabled { - server.channels.loadRegisteredChannels(config) - } // resize history buffers as needed if config.historyChangedFrom(oldConfig) { for _, channel := range server.channels.Channels() { From 78f342655d873d01d33db0115cd3c239240effd9 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 25 Feb 2024 03:52:52 -0500 Subject: [PATCH 2/2] clean up dead code --- irc/getters.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/irc/getters.go b/irc/getters.go index baf86cc6..18ae58a4 100644 --- a/irc/getters.go +++ b/irc/getters.go @@ -19,10 +19,6 @@ func (server *Server) Config() (config *Config) { return server.config.Load() } -func (server *Server) ChannelRegistrationEnabled() bool { - return server.Config().Channels.Registration.Enabled -} - func (server *Server) GetOperator(name string) (oper *Oper) { name, err := CasefoldName(name) if err != nil {