Skip to content

Commit

Permalink
add emoji support to ntfy
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBrax committed Jan 26, 2024
1 parent b84a704 commit 6c4ed6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/src/Core/ClientBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class ClientBroker {
NotificationProvider.TELEGRAM
)
) {
TelegramNotify(title, body, icon, category, url, tts);
TelegramNotify(title, body, icon, category, url);
}

if (
Expand All @@ -266,7 +266,7 @@ export class ClientBroker {
NotificationProvider.NTFY
)
) {
NtfyNotify(title, body, icon, category, url, tts);
NtfyNotify(title, body, icon, category, url);
}

if (
Expand Down
3 changes: 2 additions & 1 deletion server/src/Core/Notifiers/Ntfy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function notify(
icon = "",
category: NotificationCategory, // change this?
url = "",
tts = false
emoji = ""
) {
const ntfyUrl = Config.getInstance().cfg<string>("notifications.ntfy.url");

Expand All @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions server/src/Core/Notifiers/Telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, "\\$&");
Expand Down

0 comments on commit 6c4ed6e

Please sign in to comment.