Add forwarding, friend controls, and benefits

Add message forwarding and reply lookup, friend removal and blocking endpoints, and database-backed Govor+ privileges with customizable profile tags. Include migrations, integration tests, and updated API and operations documentation.
This commit is contained in:
Artemy
2026-10-31 18:29:40 +07:00
parent a3401ceedf
commit 632ac04b56
78 changed files with 5284 additions and 720 deletions
+12 -1
View File
@@ -13,6 +13,17 @@ public class FriendshipService : IFriendshipService
{
_context = context;
}
public async Task RemoveFriendAsync(Guid userId, Guid currentUserId)
{
if (userId == Guid.Empty || currentUserId == Guid.Empty || userId == currentUserId)
throw new ArgumentException("Two distinct users are required.");
// A removal must never clear a block or cancel a pending request.
await _context.Friendships.Where(f => f.Status == FriendshipStatus.Accepted &&
((f.RequesterId == userId && f.AddresseeId == currentUserId) ||
(f.RequesterId == currentUserId && f.AddresseeId == userId)))
.ExecuteUpdateAsync(s => s.SetProperty(f => f.Status, FriendshipStatus.Rejected));
}
public async Task<List<User>> SearchUsersAsync(string query, Guid currentId)
{
@@ -59,4 +70,4 @@ public class FriendshipService : IFriendshipService
return friends;
}
}
}