From 04f6644b468dd506a8da48181a25fec839a7fcd3 Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 6 Mar 2025 22:42:26 +0100 Subject: [PATCH] Fix up notifier websocket if there's multiple websocket handlers --- Libraries/Core/Helpers/NotificationSendHelper.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/Core/Helpers/NotificationSendHelper.cs b/Libraries/Core/Helpers/NotificationSendHelper.cs index ff6c5ed7..f92ae7f4 100644 --- a/Libraries/Core/Helpers/NotificationSendHelper.cs +++ b/Libraries/Core/Helpers/NotificationSendHelper.cs @@ -11,7 +11,7 @@ namespace Core.Helpers; [Injectable] public class NotificationSendHelper( - IWebSocketConnectionHandler _sptWebSocketConnectionHandler, + IEnumerable _sptWebSocketConnectionHandler, HashUtil _hashUtil, SaveServer _saveServer, NotificationService _notificationService, @@ -25,7 +25,9 @@ public class NotificationSendHelper( /// public void SendMessage(string sessionID, WsNotificationEvent notificationMessage) { - var sptWebSocketConnectionHandler = _sptWebSocketConnectionHandler as SptWebSocketConnectionHandler; + var sptWebSocketConnectionHandler = _sptWebSocketConnectionHandler + .OfType() + .FirstOrDefault(wsh => wsh.GetHookUrl() == "/notifierServer/getwebsocket/"); if (sptWebSocketConnectionHandler.IsWebSocketConnected(sessionID)) {