From 8d05d80a5f70d34d15498f46ff7d093a6cd37f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Krau=C3=9F?= Date: Sun, 14 May 2023 10:36:41 +0200 Subject: [PATCH 1/2] feat: Adds message ttl to pushover notification --- server/notification-providers/pushover.js | 1 + src/components/notifications/Pushover.vue | 2 ++ src/lang/de-CH.json | 1 + src/lang/de-DE.json | 1 + src/lang/en.json | 1 + 5 files changed, 6 insertions(+) diff --git a/server/notification-providers/pushover.js b/server/notification-providers/pushover.js index e4f0ddb8..5f68bb8f 100644 --- a/server/notification-providers/pushover.js +++ b/server/notification-providers/pushover.js @@ -16,6 +16,7 @@ class Pushover extends NotificationProvider { "sound": notification.pushoversounds, "priority": notification.pushoverpriority, "title": notification.pushovertitle, + "ttl": notification.pushoverttl, "retry": "30", "expire": "3600", "html": 1, diff --git a/src/components/notifications/Pushover.vue b/src/components/notifications/Pushover.vue index d9f24b29..7ee0eafb 100644 --- a/src/components/notifications/Pushover.vue +++ b/src/components/notifications/Pushover.vue @@ -42,6 +42,8 @@ + +
*{{ $t("Required") }} diff --git a/src/lang/de-CH.json b/src/lang/de-CH.json index 3f3a860c..84d74a24 100644 --- a/src/lang/de-CH.json +++ b/src/lang/de-CH.json @@ -259,6 +259,7 @@ "More info on:": "Mehr Infos auf: {0}", "pushoverDesc1": "Notfallpriorität (2) hat standardmässig 30 Sekunden Auszeit zwischen den Versuchen und läuft nach 1 Stunde ab.", "pushoverDesc2": "Fülle das Geräte Feld aus, wenn du Benachrichtigungen an verschiedene Geräte senden möchtest.", + "pushoverMessageTtl": "Message TTL (Sekunden)", "SMS Type": "SMS Typ", "octopushTypePremium": "Premium (Schnell - zur Benachrichtigung empfohlen)", "octopushTypeLowCost": "Kostengünstig (Langsam - manchmal vom Betreiber gesperrt)", diff --git a/src/lang/de-DE.json b/src/lang/de-DE.json index 48a8cd71..42460c51 100644 --- a/src/lang/de-DE.json +++ b/src/lang/de-DE.json @@ -259,6 +259,7 @@ "More info on:": "Mehr Infos auf: {0}", "pushoverDesc1": "Notfallpriorität (2) hat standardmäßig 30 Sekunden Auszeit zwischen den Versuchen und läuft nach 1 Stunde ab.", "pushoverDesc2": "Fülle das Geräte Feld aus, wenn du Benachrichtigungen an verschiedene Geräte senden möchtest.", + "pushoverMessageTtl": "Message TTL (Sekunden)", "SMS Type": "SMS Typ", "octopushTypePremium": "Premium (Schnell - zur Benachrichtigung empfohlen)", "octopushTypeLowCost": "Kostengünstig (Langsam - manchmal vom Betreiber gesperrt)", diff --git a/src/lang/en.json b/src/lang/en.json index f33a7de3..956b120d 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -556,6 +556,7 @@ "More info on:": "More info on: {0}", "pushoverDesc1": "Emergency priority (2) has default 30 second timeout between retries and will expire after 1 hour.", "pushoverDesc2": "If you want to send notifications to different devices, fill out Device field.", + "pushoverMessageTtl": "Message TTL (Seconds)", "SMS Type": "SMS Type", "octopushTypePremium": "Premium (Fast - recommended for alerting)", "octopushTypeLowCost": "Low Cost (Slow - sometimes blocked by operator)", From a0d0d5b0159c9ab21f31af3fb62a0e075e127631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Krau=C3=9F?= Date: Tue, 16 May 2023 18:31:28 +0200 Subject: [PATCH 2/2] fix: sends pushover ttl only if defined --- server/notification-providers/pushover.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/notification-providers/pushover.js b/server/notification-providers/pushover.js index 5f68bb8f..b9899e4d 100644 --- a/server/notification-providers/pushover.js +++ b/server/notification-providers/pushover.js @@ -16,7 +16,6 @@ class Pushover extends NotificationProvider { "sound": notification.pushoversounds, "priority": notification.pushoverpriority, "title": notification.pushovertitle, - "ttl": notification.pushoverttl, "retry": "30", "expire": "3600", "html": 1, @@ -25,6 +24,9 @@ class Pushover extends NotificationProvider { if (notification.pushoverdevice) { data.device = notification.pushoverdevice; } + if (notification.pushoverttl) { + data.ttl = notification.pushoverttl; + } try { if (heartbeatJSON == null) {