Add Webinar ID Support for Viewer Join and Leave ...

This commit is contained in:
2025-11-16 09:46:46 +03:30
parent 5b23542008
commit 95c1536924
2 changed files with 27 additions and 11 deletions
+17 -11
View File
@@ -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
);
}
+10
View File
@@ -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 ...