mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Add online pinging and friendship verification features
Introduces OnlinePingingController and related integration/unit tests for user online status updates. Adds PingHandlerService with memory cache throttling, IPingHandlerService interface, and service registration. Implements VerifyFriendship service and interface for friendship validation, with exception handling. Refactors CurrentUserService for improved user ID extraction and testability. Updates ChatsHub to verify friendship before messaging. Cleans up MediaController and optimizes UsersRepository queries by removing unnecessary includes.
This commit is contained in:
@@ -22,10 +22,6 @@ public class UsersRepository : IUsersRepository
|
||||
{
|
||||
return await _context.Users
|
||||
.AsNoTracking()
|
||||
.Include(u => u.Invite)
|
||||
.Include(u => u.ReceivedFriendRequests)
|
||||
.Include(u => u.SentFriendRequests)
|
||||
.AsSplitQuery()
|
||||
.ToListOrThrowIfEmpty(new NotFoundException("Users in Database not exists"));
|
||||
}
|
||||
|
||||
@@ -52,10 +48,6 @@ public class UsersRepository : IUsersRepository
|
||||
return await _context.Users
|
||||
.AsNoTracking()
|
||||
.Where(x => ids.Contains(x.Id))
|
||||
.Include(u => u.Invite)
|
||||
.Include(u => u.ReceivedFriendRequests)
|
||||
.Include(u => u.SentFriendRequests)
|
||||
.AsSplitQuery()
|
||||
.ToListOrThrowIfEmpty(new NotFoundByKeyException<IEnumerable<Guid>>(ids,"Users with given ids not found"));
|
||||
}
|
||||
|
||||
@@ -78,9 +70,6 @@ public class UsersRepository : IUsersRepository
|
||||
{
|
||||
return await _context.Users
|
||||
.AsNoTracking()
|
||||
.Include(u => u.Invite)
|
||||
.Include(u => u.ReceivedFriendRequests)
|
||||
.Include(u => u.SentFriendRequests)
|
||||
.AsSplitQuery()
|
||||
.Where(u => u.Id != currentUserId &&
|
||||
u.Username.ToLower().Contains(query.ToLower()) &&
|
||||
|
||||
Reference in New Issue
Block a user