From f207089269a5070be395785996269a9371cbbb7c Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 30 Jun 2023 16:08:28 +0200 Subject: [PATCH] revert scheduler/dispatcher changes --- includes/class-scheduler.php | 51 ++++++++++-------------------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/includes/class-scheduler.php b/includes/class-scheduler.php index 94a74a8..ddb68e1 100644 --- a/includes/class-scheduler.php +++ b/includes/class-scheduler.php @@ -82,45 +82,22 @@ class Scheduler { return; } - // send User activities - if ( ! is_user_disabled( $post->post_author ) ) { - $activitypub_post = new Post( $post ); + $activitypub_post = new Post( $post, Users::BLOG_USER_ID ); - \wp_schedule_single_event( - \time(), - 'activitypub_send_activity', - array( $activitypub_post, $type ) - ); + \wp_schedule_single_event( + \time(), + 'activitypub_send_activity', + array( $activitypub_post, $type ) + ); - \wp_schedule_single_event( - \time(), - sprintf( - 'activitypub_send_%s_activity', - \strtolower( $type ) - ), - array( $activitypub_post ) - ); - } - - // send Blog-User activities - if ( ! is_user_disabled( User_Factory::BLOG_USER_ID ) ) { - $activitypub_post = new Post( $post, User_Factory::BLOG_USER_ID ); - - \wp_schedule_single_event( - \time(), - 'activitypub_send_activity', - array( $activitypub_post, $type ) - ); - - \wp_schedule_single_event( - \time(), - sprintf( - 'activitypub_send_%s_activity', - \strtolower( $type ) - ), - array( $activitypub_post ) - ); - } + \wp_schedule_single_event( + \time(), + sprintf( + 'activitypub_send_%s_activity', + \strtolower( $type ) + ), + array( $activitypub_post ) + ); } /**