diff --git a/includes/class-activity.php b/includes/class-activity.php index 354159d..2a18403 100644 --- a/includes/class-activity.php +++ b/includes/class-activity.php @@ -73,13 +73,19 @@ class Activity { } public function to_simple_array() { - return array( + $activity = array( '@context' => $this->context, 'type' => $this->type, 'actor' => $this->actor, 'object' => $this->object, 'to' => $this->to, ); + + if ( $this->id ) { + $activity['id'] = $this->id; + } + + return $activity; } public function to_simple_json() { diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php index e65171b..1391c64 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -160,6 +160,7 @@ class Inbox { $activity->set_object( $object ); $activity->set_actor( get_author_posts_url( $user_id ) ); $activity->set_to( $object['actor'] ); + $activity->set_id( get_author_posts_url( $user_id ) . '#follow' . preg_replace( '~^https?://~', '', $object['actor'] ) ); $activity = $activity->to_simple_json();