mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-14 12:07:46 +02:00
fix(activitypub): add target actor id to like / announce activities to send directly to note's actor
This commit is contained in:
parent
9c4f60e00b
commit
962dd305f5
5 changed files with 39 additions and 18 deletions
|
|
@ -27,11 +27,20 @@ class SchedulerController extends Controller
|
|||
|
||||
// Send activity to all followers
|
||||
foreach ($scheduledActivities as $scheduledActivity) {
|
||||
// send activity to all actor followers
|
||||
send_activity_to_followers(
|
||||
$scheduledActivity->actor,
|
||||
json_encode($scheduledActivity->payload, JSON_THROW_ON_ERROR),
|
||||
);
|
||||
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)
|
||||
);
|
||||
} else {
|
||||
// send activity to all actor followers
|
||||
send_activity_to_followers(
|
||||
$scheduledActivity->actor,
|
||||
json_encode($scheduledActivity->payload, JSON_THROW_ON_ERROR),
|
||||
);
|
||||
}
|
||||
|
||||
// set activity post to delivered
|
||||
model('ActivityModel')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue