Fix events

This commit is contained in:
Adrian Gallagher
2017-03-29 14:43:09 +11:00
parent 8243360867
commit 028902f21b

View File

@@ -98,9 +98,9 @@ func (e *Event) ExecuteAction() bool {
if action[0] == ACTION_SMS_NOTIFY {
message := fmt.Sprintf("Event triggered: %s", e.EventToString())
if action[1] == "ALL" {
smsglobal.SMSSendToAll(message, &config.GetConfig())
smsglobal.SMSSendToAll(message, config.Cfg)
} else {
smsglobal.SMSNotify(smsglobal.SMSGetNumberByName(action[1]), message, &config.GetConfig())
smsglobal.SMSNotify(smsglobal.SMSGetNumberByName(action[1], config.Cfg.SMS), message, config.Cfg)
}
}
} else {
@@ -191,7 +191,7 @@ func IsValidEvent(Exchange, Item, Condition, Action string) error {
return ErrInvalidAction
}
if action[1] != "ALL" && smsglobal.SMSGetNumberByName(action[1], &config.GetConfig().SMS) == smsglobal.ErrSMSContactNotFound {
if action[1] != "ALL" && smsglobal.SMSGetNumberByName(action[1], config.Cfg.SMS) == smsglobal.ErrSMSContactNotFound {
return ErrInvalidAction
}
} else {