Ver código fonte

add cap-notify for bouncer

tags/v1.2.0-rc1
Shivaram Lingamneni 4 anos atrás
pai
commit
8a33d68cf1
1 arquivos alterados com 11 adições e 3 exclusões
  1. 11
    3
      irc/server.go

+ 11
- 3
irc/server.go Ver arquivo

@@ -676,6 +676,14 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) {
676 676
 		addedCaps.Add(caps.STS)
677 677
 	}
678 678
 
679
+	if oldConfig != nil && config.Accounts.Bouncer.Enabled != oldConfig.Accounts.Bouncer.Enabled {
680
+		if config.Accounts.Bouncer.Enabled {
681
+			addedCaps.Add(caps.Bouncer)
682
+		} else {
683
+			removedCaps.Add(caps.Bouncer)
684
+		}
685
+	}
686
+
679 687
 	// resize history buffers as needed
680 688
 	if oldConfig != nil && oldConfig.History != config.History {
681 689
 		for _, channel := range server.channels.Channels() {
@@ -686,6 +694,9 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) {
686 694
 		}
687 695
 	}
688 696
 
697
+	// activate the new config
698
+	server.SetConfig(config)
699
+
689 700
 	// burst new and removed caps
690 701
 	var capBurstSessions []*Session
691 702
 	added := make(map[caps.Version][]string)
@@ -720,9 +731,6 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) {
720 731
 		}
721 732
 	}
722 733
 
723
-	// save a pointer to the new config
724
-	server.SetConfig(config)
725
-
726 734
 	server.logger.Info("server", "Using datastore", config.Datastore.Path)
727 735
 	if initial {
728 736
 		if err := server.loadDatastore(config); err != nil {

Carregando…
Cancelar
Salvar