From e7c05261033e34b618524c8e99ac401f5f9584b1 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 18 Dec 2020 17:30:17 +0100 Subject: [PATCH] check if it is an explicit "undo -> follow" action --- includes/rest/class-inbox.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php index 2a70bc03..68a54f58 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -273,7 +273,9 @@ class Inbox { * @param int $user_id The id of the local blog-user */ public static function handle_unfollow( $object, $user_id ) { - \Activitypub\Peer\Followers::remove_follower( $object['actor'], $user_id ); + if ( isset( $object['object'] ) && isset( $object['object']['type'] ) && 'Follow' === $object['object']['type'] ) { + \Activitypub\Peer\Followers::remove_follower( $object['actor'], $user_id ); + } } /**