From 2c21a13e03283ebddca6257fa5101cd41e31f364 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 18 Aug 2021 19:04:01 +0200 Subject: [PATCH] Fixed retry and expire required for Pushover priority 2 --- src/notification/facade.js | 2 +- src/transport/pushover.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/notification/facade.js b/src/notification/facade.js index e77f9e2..56d9ec1 100644 --- a/src/notification/facade.js +++ b/src/notification/facade.js @@ -41,7 +41,7 @@ class NotificationFacade token: token, title: parsedSubject.title, message: message, - priority: priority, + priority: Number(priority) || 0, sound: parsedSubject.sound, timestamp: this.dateTimeProvider.unixTimestamp(), url: new URL('/#/n/' + token, this.publicUrl).href diff --git a/src/transport/pushover.js b/src/transport/pushover.js index 5f077f9..35b462b 100644 --- a/src/transport/pushover.js +++ b/src/transport/pushover.js @@ -20,6 +20,12 @@ class PushoverTransport if (notification.sound) data.sound = notification.sound; + if (notification.priority === 2) + { + data.retry = 300; + data.expire = 3600; + } + const response = await axios.post("https://api.pushover.net/1/messages.json", data); logger.verbose(`Pushover API returned status code ${response.status}`);