PluginProbe
ActivityPub / 5.7.0
ActivityPub v5.7.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/scheduler/class-actor.php +0 -58 8.2.15.7.0 View file →
@@ -6,12 +6,10 @@
6 6 */
7 7
8 8 namespace Activitypub\Scheduler;
9 9
10 -use Activitypub\Activity\Activity;
11 10 use Activitypub\Collection\Actors;
12 11 use Activitypub\Collection\Extra_Fields;
13 -use Activitypub\Collection\Outbox;
14 12
15 13 use function Activitypub\add_to_outbox;
16 14 use function Activitypub\is_user_type_disabled;
17 15
@@ -49,15 +47,8 @@
49 47 \add_action( 'add_option_activitypub_actor_mode', array( self::class, 'blog_user_update' ) );
50 48 \add_action( 'update_option_activitypub_actor_mode', array( self::class, 'blog_user_update' ) );
51 49
52 50 \add_action( 'transition_post_status', array( self::class, 'schedule_post_activity' ), 33, 3 );
53 -
54 - \add_action( 'post_stuck', array( self::class, 'sticky_post_update' ) );
55 - \add_action( 'post_unstuck', array( self::class, 'sticky_post_update' ) );
56 -
57 - // User deletion handling.
58 - \add_action( 'delete_user', array( self::class, 'schedule_user_delete' ), 10, 3 );
59 - \add_filter( 'post_types_to_delete_with_user', array( self::class, 'post_types_to_delete_with_user' ) );
60 51 }
61 52
62 53 /**
63 54 * Send a profile update when relevant user meta is updated.
@@ -150,55 +141,6 @@
150 141
151 142 $actor->set_updated( gmdate( ACTIVITYPUB_DATE_TIME_RFC3339, time() ) );
152 143
153 144 add_to_outbox( $actor, 'Update', $user_id );
154 - }
155 -
156 - /**
157 - * Send a profile update when a post's sticky status changes.
158 - *
159 - * @param int $post_id The post ID.
160 - */
161 - public static function sticky_post_update( $post_id ) {
162 - $post = \get_post( $post_id );
163 -
164 - if ( ! $post ) {
165 - return;
166 - }
167 -
168 - self::schedule_profile_update( $post->post_author );
169 - }
170 -
171 - /**
172 - * Schedule a Delete activity when a user is deleted.
173 - *
174 - * @param int $user_id The user ID being deleted.
175 - */
176 - public static function schedule_user_delete( $user_id ) {
177 - // Get the actor before deletion to ensure we have the data.
178 - $actor = Actors::get_by_id( $user_id );
179 - if ( \is_wp_error( $actor ) ) {
180 - return;
181 - }
182 -
183 - $activity = new Activity();
184 - $activity->set_actor( $actor->get_id() );
185 - $activity->set_object( $actor->get_id() );
186 - $activity->set_type( 'Delete' );
187 -
188 - add_to_outbox( $activity, null, $user_id );
189 - }
190 -
191 - /**
192 - * Remove outbox from post types to delete with user.
193 - *
194 - * Outbox items should not be deleted with the user, because we
195 - * need to federate the `Delete` Activities.
196 - *
197 - * @param array $post_types The post types to delete with user.
198 - *
199 - * @return array The post types to delete with user without outbox.
200 - */
201 - public static function post_types_to_delete_with_user( $post_types ) {
202 - return \array_diff( $post_types, array( Outbox::POST_TYPE ) );
203 145 }
204 146 }