fix(activitypub): add target_actor_id for create activity to broadcast post reply
This commit is contained in:
parent
962dd305f5
commit
0128a21ec5
|
@ -28,12 +28,14 @@ class SchedulerController extends Controller
|
|||
// Send activity to all followers
|
||||
foreach ($scheduledActivities as $scheduledActivity) {
|
||||
if ($scheduledActivity->target_actor_id !== null) {
|
||||
// send activity to targeted actor
|
||||
send_activity_to_actor(
|
||||
$scheduledActivity->actor,
|
||||
$scheduledActivity->targetActor,
|
||||
json_encode($scheduledActivity->payload, JSON_THROW_ON_ERROR)
|
||||
);
|
||||
if ($scheduledActivity->actor_id !== $scheduledActivity->target_actor_id) {
|
||||
// send activity to targeted actor
|
||||
send_activity_to_actor(
|
||||
$scheduledActivity->actor,
|
||||
$scheduledActivity->targetActor,
|
||||
json_encode($scheduledActivity->payload, JSON_THROW_ON_ERROR)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// send activity to all actor followers
|
||||
send_activity_to_followers(
|
||||
|
|
|
@ -299,7 +299,7 @@ class PostModel extends BaseUuidModel
|
|||
->newActivity(
|
||||
'Create',
|
||||
$post->actor_id,
|
||||
null,
|
||||
$post->in_reply_to_id === null ? null : $post->reply_to_post->actor_id,
|
||||
$newPostId,
|
||||
$createActivity->toJSON(),
|
||||
$post->published_at,
|
||||
|
|
|
@ -39,6 +39,8 @@ class NoteObject extends ObjectType
|
|||
$this->attributedTo = $post->actor->uri;
|
||||
|
||||
if ($post->in_reply_to_id !== null) {
|
||||
$this->to[] = $post->reply_to_post->actor->uri;
|
||||
|
||||
$this->inReplyTo = $post->reply_to_post->uri;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue