💄 Optimize Like activity delivery

This commit is contained in:
2026-01-03 01:43:16 +08:00
parent 1596897a5b
commit 82b517ed2c
2 changed files with 16 additions and 9 deletions

View File

@@ -647,8 +647,9 @@ public partial class PostService(
var accountActor = accountPublisher is null
? null
: await objFactory.GetLocalActorAsync(accountPublisher.Id);
var publisherActor = await objFactory.GetLocalActorAsync(post.PublisherId.Value);
if (accountActor != null && reaction.Attitude == Shared.Models.PostReactionAttitude.Positive)
if (accountActor != null && publisherActor != null && reaction.Attitude == Shared.Models.PostReactionAttitude.Positive)
{
if (!isRemoving)
{
@@ -662,7 +663,8 @@ public partial class PostService(
.GetRequiredService<ActivityPubDeliveryService>();
await deliveryService.SendLikeActivityToLocalPostAsync(
accountActor,
post.Id
post.Id,
publisherActor
);
}
catch (Exception ex)
@@ -683,7 +685,8 @@ public partial class PostService(
.GetRequiredService<ActivityPubDeliveryService>();
await deliveryService.SendUndoLikeActivityAsync(
accountActor,
post.Id
post.Id,
publisherActor
);
}
catch (Exception ex)