Use SessionMessageType for WebSocket messages

This commit is contained in:
Niels van Velzen
2020-09-25 09:25:59 +02:00
parent 66833b2d6b
commit 72534f9d66
24 changed files with 156 additions and 63 deletions

View File

@@ -11,6 +11,7 @@ using System.Threading.Tasks;
using MediaBrowser.Common.Json;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Session;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
@@ -227,7 +228,7 @@ namespace Emby.Server.Implementations.HttpServer
Connection = this
};
if (info.MessageType.Equals("KeepAlive", StringComparison.Ordinal))
if (info.MessageType == SessionMessageType.KeepAlive)
{
await SendKeepAliveResponse().ConfigureAwait(false);
}
@@ -244,7 +245,7 @@ namespace Emby.Server.Implementations.HttpServer
new WebSocketMessage<string>
{
MessageId = Guid.NewGuid(),
MessageType = "KeepAlive"
MessageType = SessionMessageType.KeepAlive
}, CancellationToken.None);
}