Add Webinar ID Support for Viewer Join and Leave ...
This commit is contained in:
+17
-11
@@ -12,7 +12,7 @@ using xPushService.Base;
|
||||
using xPushService.Extensions;
|
||||
using xWebinarService.Constants;
|
||||
using xWebinarService.Models.Dtos;
|
||||
using xWebinarService.Providers;
|
||||
using xWebinarService.Interfaces;
|
||||
|
||||
namespace xWebinarService.Hub
|
||||
{
|
||||
@@ -20,14 +20,14 @@ namespace xWebinarService.Hub
|
||||
{
|
||||
//
|
||||
#region Props ...
|
||||
public readonly XWebinarProvider webinarProvider;
|
||||
public readonly IXWebinarProvider webinarProvider;
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Constructor ...
|
||||
public XWebinarHub(
|
||||
ILogger<XWebinarHub> logger,
|
||||
XWebinarProvider webinarProvider
|
||||
IXWebinarProvider webinarProvider
|
||||
) : base(logger)
|
||||
{
|
||||
this.webinarProvider = webinarProvider;
|
||||
@@ -260,7 +260,12 @@ namespace xWebinarService.Hub
|
||||
|
||||
//
|
||||
// Notify Other Users which a Viewer Joined ...
|
||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerJoined.GetStringValue(), connectionId, userInfo.UserId, userInfo.UserName);
|
||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerJoined.GetStringValue(),
|
||||
connectionId,
|
||||
webinarId,
|
||||
userInfo.UserId,
|
||||
userInfo.UserName
|
||||
);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -339,9 +344,10 @@ namespace xWebinarService.Hub
|
||||
|
||||
//
|
||||
// Notify Other Users which a Viewer Leaved ...
|
||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerLeaved.GetStringValue(),
|
||||
connectionId,
|
||||
userInfo.UserId,
|
||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerLeaved.GetStringValue(),
|
||||
connectionId,
|
||||
webinarId,
|
||||
userInfo.UserId,
|
||||
userInfo.UserName
|
||||
);
|
||||
}
|
||||
@@ -420,10 +426,10 @@ namespace xWebinarService.Hub
|
||||
|
||||
//
|
||||
// Notify Other Users which a Viewer Leaved ...
|
||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.Message.GetStringValue(),
|
||||
connectionId,
|
||||
userInfo.UserId,
|
||||
userInfo.UserName,
|
||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.Message.GetStringValue(),
|
||||
connectionId,
|
||||
userInfo.UserId,
|
||||
userInfo.UserName,
|
||||
message
|
||||
);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ namespace xWebinarService.Providers
|
||||
Id = model.Id,
|
||||
Type = model.Type,
|
||||
OwnerId = model.OwnerId,
|
||||
Enabled = model.Enabled,
|
||||
CreatedOn = model.CreatedOn,
|
||||
|
||||
//
|
||||
@@ -334,6 +335,15 @@ namespace xWebinarService.Providers
|
||||
entity.Type = item.Type;
|
||||
entity = await WebinarRepository.UpdateAsync(entity.Id, entity);
|
||||
}
|
||||
|
||||
//
|
||||
// Check if Enabled Change Update it ...
|
||||
if (entity.Enabled != item.Enabled)
|
||||
{
|
||||
//
|
||||
entity.Enabled = item.Enabled;
|
||||
entity = await WebinarRepository.UpdateAsync(entity.Id, entity);
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve Entity Dto ...
|
||||
|
||||
Reference in New Issue
Block a user