Engine improvements

This commit is contained in:
Adrian Gallagher
2019-06-10 20:02:09 +10:00
parent 04c7c4895f
commit f777e68716
88 changed files with 2037 additions and 1413 deletions

View File

@@ -299,6 +299,7 @@ func (c *Config) CheckCommunicationsConfig() {
} else {
c.Communications.SMSGlobalConfig = SMSGlobalConfig{
Name: "SMSGlobal",
From: c.Name,
Username: "main",
Password: "test",
@@ -328,6 +329,10 @@ func (c *Config) CheckCommunicationsConfig() {
}
} else {
if c.Communications.SMSGlobalConfig.From == "" {
c.Communications.SMSGlobalConfig.From = c.Name
}
if c.SMS != nil {
// flush old SMS config
c.SMS = nil
@@ -931,7 +936,7 @@ func (c *Config) CheckExchangeConfigValues() error {
c.Exchanges[i].Enabled = false
continue
}
if c.Exchanges[i].API.AuthenticatedSupport {
if c.Exchanges[i].API.AuthenticatedSupport && c.Exchanges[i].API.CredentialsValidator != nil {
if c.Exchanges[i].API.CredentialsValidator.RequiresKey && (c.Exchanges[i].API.Credentials.Key == "" || c.Exchanges[i].API.Credentials.Key == DefaultAPIKey) {
c.Exchanges[i].API.AuthenticatedSupport = false
}

View File

@@ -222,6 +222,7 @@ type SMSContact struct {
// messaging and broadcast used by SMSGlobal
type SMSGlobalConfig struct {
Name string `json:"name"`
From string `json:"from"`
Enabled bool `json:"enabled"`
Verbose bool `json:"verbose"`
Username string `json:"username"`