only include the minimum required fields for Accept call
This commit is contained in:
parent
30eb07ba17
commit
626203002a
1 changed files with 13 additions and 6 deletions
|
@ -265,11 +265,18 @@ class Followers {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $object['user_id'] ) ) {
|
// only send minimal data
|
||||||
unset( $object['user_id'] );
|
$object = array_intersect_key(
|
||||||
}
|
$object,
|
||||||
|
array_flip(
|
||||||
unset( $object['@context'] );
|
array(
|
||||||
|
'id',
|
||||||
|
'type',
|
||||||
|
'actor',
|
||||||
|
'object',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$user = Users::get_by_id( $user_id );
|
$user = Users::get_by_id( $user_id );
|
||||||
|
|
||||||
|
@ -282,7 +289,7 @@ class Followers {
|
||||||
$activity->set_object( $object );
|
$activity->set_object( $object );
|
||||||
$activity->set_actor( $user->get_id() );
|
$activity->set_actor( $user->get_id() );
|
||||||
$activity->set_to( $actor );
|
$activity->set_to( $actor );
|
||||||
$activity->set_id( $user->get_id() . '#follow-' . \preg_replace( '~^https?://~', '', $actor ) );
|
$activity->set_id( $user->get_id() . '#follow-' . \preg_replace( '~^https?://~', '', $actor ) . '-' . \time() );
|
||||||
|
|
||||||
$activity = $activity->to_json();
|
$activity = $activity->to_json();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue