From d8d5dd487326dd3fccf4e9f30cd8f7e3783fcfda Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 12 Jan 2015 22:46:44 -0500 Subject: make channel access opt-in rather than opt out --- MediaBrowser.Controller/Session/ISessionController.cs | 10 ++++++++++ MediaBrowser.Controller/Session/ISessionManager.cs | 11 +++++++++++ MediaBrowser.Controller/Session/SessionInfo.cs | 5 +++++ 3 files changed, 26 insertions(+) (limited to 'MediaBrowser.Controller/Session') diff --git a/MediaBrowser.Controller/Session/ISessionController.cs b/MediaBrowser.Controller/Session/ISessionController.cs index d6dd7698e..a4badee47 100644 --- a/MediaBrowser.Controller/Session/ISessionController.cs +++ b/MediaBrowser.Controller/Session/ISessionController.cs @@ -105,5 +105,15 @@ namespace MediaBrowser.Controller.Session /// The cancellation token. /// Task. Task SendServerRestartNotification(CancellationToken cancellationToken); + + /// + /// Sends the message. + /// + /// + /// The name. + /// The data. + /// The cancellation token. + /// Task. + Task SendMessage(string name, T data, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index f0272b335..1f273a3ee 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -170,6 +170,17 @@ namespace MediaBrowser.Controller.Session /// Task. Task SendPlaystateCommand(string controllingSessionId, string sessionId, PlaystateRequest command, CancellationToken cancellationToken); + /// + /// Sends the message to user sessions. + /// + /// + /// The user identifier. + /// The name. + /// The data. + /// The cancellation token. + /// Task. + Task SendMessageToUserSessions(string userId, string name, T data, CancellationToken cancellationToken); + /// /// Sends the restart required message. /// diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index d8a2464d6..078d4d70f 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -160,6 +160,11 @@ namespace MediaBrowser.Controller.Session } } + public bool ContainsUser(string userId) + { + return ContainsUser(new Guid(userId)); + } + public bool ContainsUser(Guid userId) { return (UserId ?? Guid.Empty) == userId || AdditionalUsers.Any(i => userId == new Guid(i.UserId)); -- cgit v1.2.3