PluginProbe
ActivityPub / 9.2.1
ActivityPub v9.2.1
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/handler/class-delete.php +4 -14 9.3.09.2.1 View file →
@@ -6,9 +6,8 @@
6 6 */
7 7
8 8 namespace Activitypub\Handler;
9 9
10 -use Activitypub\Collection\Inbox;
11 10 use Activitypub\Collection\Interactions;
12 11 use Activitypub\Collection\Remote_Actors;
13 12 use Activitypub\Collection\Remote_Posts;
14 13 use Activitypub\Tombstone;
@@ -22,10 +21,9 @@
22 21 /**
23 22 * Initialize the class, registering WordPress hooks.
24 23 */
25 24 public static function init() {
26 - \add_action( 'activitypub_inbox_delete', array( self::class, 'handle_delete' ), 10, 4 );
27 - \add_action( 'activitypub_inbox_shared_delete', array( self::class, 'handle_delete' ), 10, 4 );
25 + \add_action( 'activitypub_inbox_delete', array( self::class, 'handle_delete' ), 10, 2 );
28 26 \add_filter( 'activitypub_skip_inbox_storage', array( self::class, 'skip_inbox_storage' ), 10, 2 );
29 27 \add_filter( 'activitypub_defer_signature_verification', array( self::class, 'defer_signature_verification' ), 10, 3 );
30 28 \add_action( 'activitypub_delete_remote_actor_interactions', array( self::class, 'delete_interactions' ) );
31 29 \add_action( 'activitypub_delete_remote_actor_posts', array( self::class, 'delete_posts' ) );
@@ -36,20 +34,12 @@
36 34
37 35 /**
38 36 * Handles "Delete" requests.
39 37 *
40 - * @param array $activity The delete activity.
41 - * @param int|int[] $user_ids The local user ID(s).
42 - * @param \Activitypub\Activity\Activity|null $activity_object Optional. The activity object. Default null.
43 - * @param string|null $context Optional. The inbox context. Default null.
38 + * @param array $activity The delete activity.
39 + * @param int|int[] $user_ids The local user ID(s).
44 40 */
45 - public static function handle_delete( $activity, $user_ids, $activity_object = null, $context = null ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
46 - // The shared inbox invokes this once per resolved recipient and once on the shared hook;
47 - // handle that path only on the shared hook, so it runs once with the full recipient list.
48 - if ( Inbox::CONTEXT_SHARED_INBOX === $context && 'activitypub_inbox_shared_delete' !== \current_filter() ) {
49 - return;
50 - }
51 -
41 + public static function handle_delete( $activity, $user_ids ) {
52 42 $object_type = $activity['object']['type'] ?? '';
53 43
54 44 switch ( $object_type ) {
55 45 /*