make default channel modes configurable

This commit is contained in:
Shivaram Lingamneni
2017-09-06 17:34:38 -04:00
parent a50e68af4d
commit 333afe1062
5 changed files with 32 additions and 1 deletions
+4
View File
@@ -97,6 +97,7 @@ type Server struct {
connectionThrottleMutex sync.Mutex // used when affecting the connection limiter, to make sure rehashing doesn't make things go out-of-whack
ctime time.Time
currentOpers map[*Client]bool
defaultChannelModes Modes
dlines *DLineManager
isupport *ISupportList
klines *KLineManager
@@ -205,6 +206,7 @@ func NewServer(configFilename string, config *Config, logger *logger.Manager) (*
connectionThrottle: connectionThrottle,
ctime: time.Now(),
currentOpers: make(map[*Client]bool),
defaultChannelModes: ParseDefaultChannelModes(config),
limits: Limits{
AwayLen: int(config.Limits.AwayLen),
ChannelLen: int(config.Limits.ChannelLen),
@@ -1620,6 +1622,8 @@ func (server *Server) rehash() error {
server.accountRegistration = &accountReg
server.channelRegistrationEnabled = config.Channels.Registration.Enabled
server.defaultChannelModes = ParseDefaultChannelModes(config)
// set new sendqueue size
if config.Server.MaxSendQBytes != server.MaxSendQBytes {
server.MaxSendQBytes = config.Server.MaxSendQBytes