technical edits

This commit is contained in:
Artemy
2025-12-12 17:23:01 +07:00
parent bf2aca40d3
commit 7e6f914878
23 changed files with 461 additions and 114 deletions
+8 -5
View File
@@ -19,7 +19,11 @@ public class ChatsHub : Hub
private readonly IUserGroupsService _userService;
private readonly IHubUserAccessor _userAccessor;
public ChatsHub(ILogger<ChatsHub> logger, IMessageCommandService messageCommandService, IUserGroupsService userService, IHubUserAccessor userAccessor)
public ChatsHub(
ILogger<ChatsHub> logger,
IMessageCommandService messageCommandService,
IUserGroupsService userService,
IHubUserAccessor userAccessor)
{
_logger = logger;
_messageCommandService = messageCommandService;
@@ -60,10 +64,8 @@ public class ChatsHub : Hub
_logger.LogInformation("User {UserId} disconnected with ConnectionId {ConnectionId} and removed from their group",
userId, Context.ConnectionId);
var userGroups =
await _userService
.GetUserGroupsAsync(
userId);
var userGroups = await _userService.GetUserGroupsAsync(userId);
foreach (var group in userGroups)
{
await Groups.RemoveFromGroupAsync(Context.ConnectionId, $"group_{group.Id}");
@@ -236,6 +238,7 @@ public class ChatsHub : Hub
}
}
#region common
private UserMessageResponse BuildUserMessageResponse(Message message, Guid? replyToId)
{