Fix up notifier websocket if there's multiple websocket handlers

This commit is contained in:
Archangel
2025-03-06 22:42:26 +01:00
parent 6f1aeead4f
commit 04f6644b46
@@ -11,7 +11,7 @@ namespace Core.Helpers;
[Injectable]
public class NotificationSendHelper(
IWebSocketConnectionHandler _sptWebSocketConnectionHandler,
IEnumerable<IWebSocketConnectionHandler> _sptWebSocketConnectionHandler,
HashUtil _hashUtil,
SaveServer _saveServer,
NotificationService _notificationService,
@@ -25,7 +25,9 @@ public class NotificationSendHelper(
/// <param name="notificationMessage"></param>
public void SendMessage(string sessionID, WsNotificationEvent notificationMessage)
{
var sptWebSocketConnectionHandler = _sptWebSocketConnectionHandler as SptWebSocketConnectionHandler;
var sptWebSocketConnectionHandler = _sptWebSocketConnectionHandler
.OfType<SptWebSocketConnectionHandler>()
.FirstOrDefault(wsh => wsh.GetHookUrl() == "/notifierServer/getwebsocket/");
if (sptWebSocketConnectionHandler.IsWebSocketConnected(sessionID))
{