multi mode: Simplify code

Just like it's done in the single mode.
This commit is contained in:
Thorben Günther 2023-02-21 14:02:19 +01:00
parent cd848543b3
commit d7fdd85b72
No known key found for this signature in database
GPG key ID: 415CD778D8C5AFED

View file

@ -183,7 +183,6 @@ func (br *bridge) multiAlertNotification(p *payload) *notification {
}
n.body = body
var priority string
var tags []string
if p.Status == "resolved" {
tags = append(tags, br.cfg.resolved.Tags...)
@ -201,8 +200,8 @@ func (br *bridge) multiAlertNotification(p *payload) *notification {
continue
}
if priority == "" {
priority = labelConfig.Priority
if n.priority == "" {
n.priority = labelConfig.Priority
}
if n.icon == "" {
@ -216,9 +215,7 @@ func (br *bridge) multiAlertNotification(p *payload) *notification {
}
}
tagString := strings.Join(tags, ",")
n.priority = priority
n.tags = tagString
n.tags = strings.Join(tags, ",")
if br.cfg.am.SilenceDuration != 0 && p.Status == "firing" {
if br.cfg.BaseURL == "" {