Merge PR #53: Only send configuration updates if the channel exists

This commit is contained in:
Davide Beatrici 2020-03-26 04:57:20 +01:00 committed by GitHub
commit a6dc45193a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -193,8 +193,11 @@ func (server *Server) SetSuperUserPassword(password string) {
key := "SuperUserPassword" key := "SuperUserPassword"
val := "sha1$" + salt + "$" + digest val := "sha1$" + salt + "$" + digest
server.cfg.Set(key, val) server.cfg.Set(key, val)
if server.cfgUpdate != nil {
server.cfgUpdate <- &KeyValuePair{Key: key, Value: val} server.cfgUpdate <- &KeyValuePair{Key: key, Value: val}
} }
}
// CheckSuperUserPassword checks whether password matches the set SuperUser password. // CheckSuperUserPassword checks whether password matches the set SuperUser password.
func (server *Server) CheckSuperUserPassword(password string) bool { func (server *Server) CheckSuperUserPassword(password string) bool {