parent
e8bcf6c9e6
commit
67909bc71a
|
@ -130,7 +130,7 @@ class NotificationFacade
|
|||
try
|
||||
{
|
||||
this.logger.info(`Sending notification '${notification.id}' with token '${notification.token}' to '${contact.description}' (attempt ${attempt})`);
|
||||
await transport.send(contact, notification);
|
||||
await transport.send(this.logger, contact, notification);
|
||||
|
||||
this.logger.info(`Notification '${notification.id}' succesfully sent to '${contact.description}'`);
|
||||
return;
|
||||
|
|
|
@ -69,6 +69,7 @@ class NotificationRepository
|
|||
}
|
||||
|
||||
this.logger.info(`Latching notification with id ${id} and token '${token}', send permitted`);
|
||||
notification.title = title;
|
||||
notification.latched = true;
|
||||
notification.latchTime = now;
|
||||
notification.reminders = true;
|
||||
|
|
|
@ -3,7 +3,7 @@ const axios = require('axios');
|
|||
|
||||
class PushoverTransport
|
||||
{
|
||||
async send(contact, notification)
|
||||
async send(logger, contact, notification)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -21,7 +21,9 @@ class PushoverTransport
|
|||
data.sound = notification.sound;
|
||||
|
||||
const response = await axios.post("https://api.pushover.net/1/messages.json", data);
|
||||
return response.statu;
|
||||
logger.verbose(`Pushover API returned status code ${response.status}`);
|
||||
|
||||
return response.status === 200;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue