From d7fdd85b72e1e486f145520e643de70ec98aab38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Tue, 21 Feb 2023 14:02:19 +0100 Subject: [PATCH] multi mode: Simplify code Just like it's done in the single mode. --- main.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index b23aa21..cbcda6f 100644 --- a/main.go +++ b/main.go @@ -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 == "" {