fixed pleroma following issue

fixed #19
This commit is contained in:
Matthias Pfefferle 2019-03-09 01:22:49 +01:00
parent f10921e554
commit 669d0d6141
2 changed files with 8 additions and 1 deletions

View file

@ -73,13 +73,19 @@ class Activity {
} }
public function to_simple_array() { public function to_simple_array() {
return array( $activity = array(
'@context' => $this->context, '@context' => $this->context,
'type' => $this->type, 'type' => $this->type,
'actor' => $this->actor, 'actor' => $this->actor,
'object' => $this->object, 'object' => $this->object,
'to' => $this->to, 'to' => $this->to,
); );
if ( $this->id ) {
$activity['id'] = $this->id;
}
return $activity;
} }
public function to_simple_json() { public function to_simple_json() {

View file

@ -160,6 +160,7 @@ class Inbox {
$activity->set_object( $object ); $activity->set_object( $object );
$activity->set_actor( get_author_posts_url( $user_id ) ); $activity->set_actor( get_author_posts_url( $user_id ) );
$activity->set_to( $object['actor'] ); $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(); $activity = $activity->to_simple_json();