From e1bfdd675bb2a41f5d89f8712c8c83901376193c Mon Sep 17 00:00:00 2001 From: Glax Date: Mon, 16 Dec 2024 20:33:59 +0100 Subject: [PATCH] NotificationConnector SendNotification public --- API/Schema/NotificationConnectors/Gotify.cs | 2 +- API/Schema/NotificationConnectors/Lunasea.cs | 2 +- API/Schema/NotificationConnectors/NotificationConnector.cs | 2 +- API/Schema/NotificationConnectors/Ntfy.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/API/Schema/NotificationConnectors/Gotify.cs b/API/Schema/NotificationConnectors/Gotify.cs index ca8bb6c..352fbda 100644 --- a/API/Schema/NotificationConnectors/Gotify.cs +++ b/API/Schema/NotificationConnectors/Gotify.cs @@ -9,7 +9,7 @@ public class Gotify(string endpoint, string appToken) public string Endpoint { get; init; } = endpoint; public string AppToken { get; init; } = appToken; - protected override void SendNotificationInternal(string title, string notificationText) + public override void SendNotification(string title, string notificationText) { MessageData message = new(title, notificationText); HttpRequestMessage request = new(HttpMethod.Post, $"{endpoint}/message"); diff --git a/API/Schema/NotificationConnectors/Lunasea.cs b/API/Schema/NotificationConnectors/Lunasea.cs index 7463de5..498811d 100644 --- a/API/Schema/NotificationConnectors/Lunasea.cs +++ b/API/Schema/NotificationConnectors/Lunasea.cs @@ -7,7 +7,7 @@ public class Lunasea(string id) : NotificationConnector(TokenGen.CreateToken(typeof(Lunasea), 64), NotificationConnectorType.LunaSea) { public string Id { get; init; } = id; - protected override void SendNotificationInternal(string title, string notificationText) + public override void SendNotification(string title, string notificationText) { MessageData message = new(title, notificationText); HttpRequestMessage request = new(HttpMethod.Post, $"https://notify.lunasea.app/v1/custom/{id}"); diff --git a/API/Schema/NotificationConnectors/NotificationConnector.cs b/API/Schema/NotificationConnectors/NotificationConnector.cs index b110215..0c29670 100644 --- a/API/Schema/NotificationConnectors/NotificationConnector.cs +++ b/API/Schema/NotificationConnectors/NotificationConnector.cs @@ -16,5 +16,5 @@ public abstract class NotificationConnector(string notificationConnectorId, Noti [NotMapped] protected readonly HttpClient _client = new(); - protected abstract void SendNotificationInternal(string title, string notificationText); + public abstract void SendNotification(string title, string notificationText); } \ No newline at end of file diff --git a/API/Schema/NotificationConnectors/Ntfy.cs b/API/Schema/NotificationConnectors/Ntfy.cs index 318b502..e95c6a5 100644 --- a/API/Schema/NotificationConnectors/Ntfy.cs +++ b/API/Schema/NotificationConnectors/Ntfy.cs @@ -45,7 +45,7 @@ public class Ntfy : NotificationConnector return ret; } - protected override void SendNotificationInternal(string title, string notificationText) + public override void SendNotification(string title, string notificationText) { MessageData message = new(title, Topic, notificationText); HttpRequestMessage request = new(HttpMethod.Post, $"{this.Endpoint}?auth={this.Auth}");