config: Allow enabling/disabling channel reg

This commit is contained in:
Daniel Oaks
2017-03-24 12:52:38 +10:00
parent ea748a9f7b
commit 70b7606996
5 changed files with 25 additions and 0 deletions
+3
View File
@@ -84,6 +84,7 @@ type Server struct {
accountAuthenticationEnabled bool
accountRegistration *AccountRegistration
accounts map[string]*ClientAccount
channelRegistrationEnabled bool
channels ChannelNameMap
checkIdent bool
clients *ClientLookupSet
@@ -190,6 +191,7 @@ func NewServer(configFilename string, config *Config, logger *logger.Manager) (*
server := &Server{
accountAuthenticationEnabled: config.Accounts.AuthenticationEnabled,
accounts: make(map[string]*ClientAccount),
channelRegistrationEnabled: config.Channels.Registration.Enabled,
channels: make(ChannelNameMap),
checkIdent: config.Server.CheckIdent,
clients: NewClientLookupSet(),
@@ -1424,6 +1426,7 @@ func (server *Server) rehash() error {
// registration
accountReg := NewAccountRegistration(config.Accounts.Registration)
server.accountRegistration = &accountReg
server.channelRegistrationEnabled = config.Channels.Registration.Enabled
// set new sendqueue size
if config.Server.MaxSendQBytes != server.MaxSendQBytes {