Moved notification formatting function (#7781)

This commit is contained in:
Matteo Biscosi 2023-08-25 09:19:44 +00:00
parent ba330e8e0d
commit 144de3a7e6
9 changed files with 75 additions and 35 deletions

View file

@ -6,6 +6,7 @@ require "lua_utils"
local json = require "dkjson"
local alert_consts = require("alert_consts")
local alert_utils = require "alert_utils"
local format_utils = require "format_utils"
local slack = {
name = "Slack",
@ -129,7 +130,7 @@ function slack.dequeueRecipientAlerts(recipient, budget)
-- Most recent notifications first
for _, notif in pairsByValues(notifications, alert_utils.notification_timestamp_rev) do
local msg = alert_utils.formatAlertNotification(notif, {nohtml=true, show_severity=false, show_entity=true})
local msg = format_utils.formatMessage(notif, {nohtml=true, show_severity=false, show_entity=true})
table.insert(messages, msg)
if #messages >= MAX_ALERTS_PER_MESSAGE then