🐛 Fix post-reply will still create normal activities

🐛 Fix publisher get by name endpoint requires authorization
This commit is contained in:
2025-05-25 12:12:37 +08:00
parent 185ab13ec9
commit 68399dd371
2 changed files with 5 additions and 4 deletions

View File

@ -133,9 +133,11 @@ public class ActivityService(AppDatabase db)
var identifier = $"posts/{post.Id}";
if (post.RepliedPostId is not null)
{
var ogPost = await db.Posts.Where(e => e.Id == post.RepliedPostId).Include(e => e.Publisher)
var ogPost = await db.Posts
.Where(e => e.Id == post.RepliedPostId)
.Include(e => e.Publisher)
.FirstOrDefaultAsync();
if (ogPost == null) return;
if (ogPost?.Publisher.AccountId == null) return;
await CreateActivity(
user,
"posts.new.replies",
@ -143,6 +145,7 @@ public class ActivityService(AppDatabase db)
ActivityVisibility.Selected,
[ogPost.Publisher.AccountId!.Value]
);
return;
}
await CreateActivity(