diff --git a/includes/activitypub/handler/class-accept.php b/includes/activitypub/handler/class-accept.php index fc1662b..d505827 100644 --- a/includes/activitypub/handler/class-accept.php +++ b/includes/activitypub/handler/class-accept.php @@ -75,6 +75,6 @@ class Accept { ); // Trigger the backfilling of events from this actor. - \do_action( 'event_bridge_for_activitypub_backfill_events', $activity['actor'] ); + \do_action( 'event_bridge_for_activitypub_backfill_events', $event_source ); } } diff --git a/includes/class-outbox-parser.php b/includes/class-outbox-parser.php index dee9c93..8ffc094 100644 --- a/includes/class-outbox-parser.php +++ b/includes/class-outbox-parser.php @@ -39,17 +39,10 @@ class Outbox_Parser { /** * Initialize the backfilling of events via the outbox of an ActivityPub actor. * - * @param string $actor The ActivityPub ID of the actor which owns the outbox. + * @param Event_Source $event_source The Source we want to backfill the events for. * @return bool|WP_Error */ - public static function backfill_events( $actor ) { - // Initiate parsing of outbox collection. - $event_source = Event_Source::get_by_id( $actor ); - - if ( ! $event_source ) { - return; - } - + public static function backfill_events( $event_source ) { $outbox_url = $event_source->get_outbox(); if ( ! $outbox_url ) { @@ -57,7 +50,7 @@ class Outbox_Parser { } // Schedule the import of events via the outbox. - return self::queue_importing_from_outbox( $outbox_url, $actor, 0 ); + return self::queue_importing_from_outbox( $outbox_url, $event_source->get_id(), 0 ); } /**