From 669d0d6141065aa9c2b1c46c8dabeadabe7a40c9 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Sat, 9 Mar 2019 01:22:49 +0100 Subject: [PATCH] fixed pleroma following issue fixed #19 --- includes/class-activity.php | 8 +++++++- includes/rest/class-inbox.php | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) 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();