From 6c4ed6e516d937c2bd61eca50de21c070cc14625 Mon Sep 17 00:00:00 2001 From: "CATERPILLAR\\Braxen" Date: Fri, 26 Jan 2024 15:09:30 +0100 Subject: [PATCH] add emoji support to ntfy --- server/src/Core/ClientBroker.ts | 4 ++-- server/src/Core/Notifiers/Ntfy.ts | 3 ++- server/src/Core/Notifiers/Telegram.ts | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/Core/ClientBroker.ts b/server/src/Core/ClientBroker.ts index be96cc33..1003d5a3 100644 --- a/server/src/Core/ClientBroker.ts +++ b/server/src/Core/ClientBroker.ts @@ -256,7 +256,7 @@ export class ClientBroker { NotificationProvider.TELEGRAM ) ) { - TelegramNotify(title, body, icon, category, url, tts); + TelegramNotify(title, body, icon, category, url); } if ( @@ -266,7 +266,7 @@ export class ClientBroker { NotificationProvider.NTFY ) ) { - NtfyNotify(title, body, icon, category, url, tts); + NtfyNotify(title, body, icon, category, url); } if ( diff --git a/server/src/Core/Notifiers/Ntfy.ts b/server/src/Core/Notifiers/Ntfy.ts index bf0083eb..4932754b 100644 --- a/server/src/Core/Notifiers/Ntfy.ts +++ b/server/src/Core/Notifiers/Ntfy.ts @@ -10,7 +10,7 @@ export default function notify( icon = "", category: NotificationCategory, // change this? url = "", - tts = false + emoji = "" ) { const ntfyUrl = Config.getInstance().cfg("notifications.ntfy.url"); @@ -22,6 +22,7 @@ export default function notify( Title: title, Actions: url ? `view, Open, ${url}` : undefined, Icon: icon ?? undefined, + Tags: emoji ? `${emoji},${category}` : category, }, data: body, method: "POST", diff --git a/server/src/Core/Notifiers/Telegram.ts b/server/src/Core/Notifiers/Telegram.ts index c0c9b042..ce1e9fcd 100644 --- a/server/src/Core/Notifiers/Telegram.ts +++ b/server/src/Core/Notifiers/Telegram.ts @@ -22,8 +22,7 @@ export default function notify( body = "", icon = "", category: NotificationCategory, // change this? - url = "", - tts = false + url = "" ) { // escape with backslash // const escaped_title = title.replace(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/g, "\\$&");