♻️ Refactored activities

This commit is contained in:
2025-06-08 23:52:02 +08:00
parent 39533cced3
commit b8341734df
11 changed files with 3512 additions and 292 deletions

View File

@ -13,7 +13,6 @@ public class PostService(
AppDatabase db,
FileService fs,
FileReferenceService fileRefService,
ActivityService act,
IStringLocalizer<NotificationResource> localizer,
NotificationService nty,
IServiceScopeFactory factory
@ -107,8 +106,6 @@ public class PostService(
}
}
await act.CreateNewPostActivity(user, post);
if (post.PublishedAt is not null && post.PublishedAt.Value.ToDateTimeUtc() <= DateTime.UtcNow)
_ = Task.Run(async () =>
{
@ -341,8 +338,12 @@ public class PostService(
public static class PostQueryExtensions
{
public static IQueryable<Post> FilterWithVisibility(this IQueryable<Post> source, Account.Account? currentUser,
List<Guid> userFriends, bool isListing = false)
public static IQueryable<Post> FilterWithVisibility(
this IQueryable<Post> source,
Account.Account? currentUser,
List<Guid> userFriends,
bool isListing = false
)
{
var now = Instant.FromDateTimeUtc(DateTime.UtcNow);