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
|
// Send activity to all followers
|
||||||
foreach ($scheduledActivities as $scheduledActivity) {
|
foreach ($scheduledActivities as $scheduledActivity) {
|
||||||
if ($scheduledActivity->target_actor_id !== null) {
|
if ($scheduledActivity->target_actor_id !== null) {
|
||||||
// send activity to targeted actor
|
if ($scheduledActivity->actor_id !== $scheduledActivity->target_actor_id) {
|
||||||
send_activity_to_actor(
|
// send activity to targeted actor
|
||||||
$scheduledActivity->actor,
|
send_activity_to_actor(
|
||||||
$scheduledActivity->targetActor,
|
$scheduledActivity->actor,
|
||||||
json_encode($scheduledActivity->payload, JSON_THROW_ON_ERROR)
|
$scheduledActivity->targetActor,
|
||||||
);
|
json_encode($scheduledActivity->payload, JSON_THROW_ON_ERROR)
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// send activity to all actor followers
|
// send activity to all actor followers
|
||||||
send_activity_to_followers(
|
send_activity_to_followers(
|
||||||
|
|
|
@ -299,7 +299,7 @@ class PostModel extends BaseUuidModel
|
||||||
->newActivity(
|
->newActivity(
|
||||||
'Create',
|
'Create',
|
||||||
$post->actor_id,
|
$post->actor_id,
|
||||||
null,
|
$post->in_reply_to_id === null ? null : $post->reply_to_post->actor_id,
|
||||||
$newPostId,
|
$newPostId,
|
||||||
$createActivity->toJSON(),
|
$createActivity->toJSON(),
|
||||||
$post->published_at,
|
$post->published_at,
|
||||||
|
|
|
@ -39,6 +39,8 @@ class NoteObject extends ObjectType
|
||||||
$this->attributedTo = $post->actor->uri;
|
$this->attributedTo = $post->actor->uri;
|
||||||
|
|
||||||
if ($post->in_reply_to_id !== null) {
|
if ($post->in_reply_to_id !== null) {
|
||||||
|
$this->to[] = $post->reply_to_post->actor->uri;
|
||||||
|
|
||||||
$this->inReplyTo = $post->reply_to_post->uri;
|
$this->inReplyTo = $post->reply_to_post->uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue