Pushover fix sounds (#9519)

* Pushover fix sounds

* fix editing issue with duplicate field ids
This commit is contained in:
Tony Murray
2018-12-10 22:18:45 -06:00
committed by GitHub
parent 170b87226d
commit f451f56e98
2 changed files with 14 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ class Pushover extends Transport
unset($pushover_opts['options']);
foreach (explode(PHP_EOL, $this->config['options']) as $option) {
list($k,$v) = explode('=', $option);
$pushover_opts['options'][$k] = $v;
$pushover_opts['options'][$k] = trim($v);
}
return $this->contactPushover($obj, $pushover_opts);
}
@@ -74,22 +74,22 @@ class Pushover extends Transport
switch ($obj['severity']) {
case "critical":
$data['priority'] = 1;
if (!empty($api['sound_critical'])) {
$data['sound'] = $api['sound_critical'];
if (!empty($api['options']['sound_critical'])) {
$data['sound'] = $api['options']['sound_critical'];
}
break;
case "warning":
$data['priority'] = 1;
if (!empty($api['sound_warning'])) {
$data['sound'] = $api['sound_warning'];
if (!empty($api['options']['sound_warning'])) {
$data['sound'] = $api['options']['sound_warning'];
}
break;
}
switch ($obj['state']) {
case 0:
$data['priority'] = 0;
if (!empty($api['sound_ok'])) {
$data['sound'] = $api['sound_ok'];
if (!empty($api['options']['sound_ok'])) {
$data['sound'] = $api['options']['sound_ok'];
}
break;
}