Профили, группы, групповые звонки
This commit is contained in:
@@ -382,6 +382,13 @@ public sealed class ChatHub : Hub
|
||||
participants = others
|
||||
});
|
||||
|
||||
// Broadcast active call participants to everyone in the chat
|
||||
await Clients.Group(chatId).SendAsync("group_call_active", new
|
||||
{
|
||||
chatId = chatId,
|
||||
participants = participants.Keys.ToList()
|
||||
});
|
||||
|
||||
if (isFirst)
|
||||
{
|
||||
await Clients.Group(chatId).SendAsync("group_call_incoming", new
|
||||
@@ -402,6 +409,14 @@ public sealed class ChatHub : Hub
|
||||
if (_groupCallParticipants.TryGetValue(chatId, out var participants))
|
||||
{
|
||||
participants.TryRemove(userId, out _);
|
||||
|
||||
// Broadcast updated participants list
|
||||
await Clients.Group(chatId).SendAsync("group_call_active", new
|
||||
{
|
||||
chatId = chatId,
|
||||
participants = participants.Keys.ToList()
|
||||
});
|
||||
|
||||
if (participants.IsEmpty)
|
||||
{
|
||||
_groupCallParticipants.TryRemove(chatId, out _);
|
||||
|
||||
Reference in New Issue
Block a user