From 7d7c8bdd31f36dd7d9e494e24f3a490c11b401e9 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 17 Feb 2025 12:28:29 +0100 Subject: [PATCH] Cast ConnectionHandler --- Libraries/Core/Helpers/NotificationSendHelper.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Libraries/Core/Helpers/NotificationSendHelper.cs b/Libraries/Core/Helpers/NotificationSendHelper.cs index 4d0fc599..cf615ff9 100644 --- a/Libraries/Core/Helpers/NotificationSendHelper.cs +++ b/Libraries/Core/Helpers/NotificationSendHelper.cs @@ -11,7 +11,7 @@ namespace Core.Helpers; [Injectable] public class NotificationSendHelper( - SptWebSocketConnectionHandler _sptWebSocketConnectionHandler, + IWebSocketConnectionHandler _sptWebSocketConnectionHandler, HashUtil _hashUtil, SaveServer _saveServer, NotificationService _notificationService, @@ -25,9 +25,11 @@ public class NotificationSendHelper( /// public void SendMessage(string sessionID, WsNotificationEvent notificationMessage) { - if (_sptWebSocketConnectionHandler.IsWebSocketConnected(sessionID)) + var sptWebSocketConnectionHandler = _sptWebSocketConnectionHandler as SptWebSocketConnectionHandler; + + if (sptWebSocketConnectionHandler.IsWebSocketConnected(sessionID)) { - _sptWebSocketConnectionHandler.SendMessage(sessionID, notificationMessage); + sptWebSocketConnectionHandler.SendMessage(sessionID, notificationMessage); } else {