Clean up 'activitypub' references

This commit is contained in:
Jeremy Dormitzer 2018-09-24 08:39:44 -04:00
parent fa945667f4
commit 4393c41426
3 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ function handle_outbox( $actor, $activity ) {
if ( !array_key_exists( 'object', $activity ) ) {
return new \WP_Error(
'invalid_activity',
__( 'Expected an object', 'activitypub' ),
__( 'Expected an object', 'pterotype' ),
array( 'status' => 400 )
);
}

View File

@ -14,17 +14,17 @@ Returns either the modified $activity or a WP_Error.
function handle_outbox( $actor_slug, $activity ) {
if ( !(array_key_exists( 'type', $activity ) && $activity['type'] === 'Create') ) {
return new \WP_Error(
'invalid_activity', __( 'Expecting a Create activity', 'activitypub' )
'invalid_activity', __( 'Expecting a Create activity', 'pterotype' )
);
}
if ( !array_key_exists( 'object', $activity ) ) {
return new \WP_Error(
'invalid_object', __( 'Expecting an object', 'activitypub' )
'invalid_object', __( 'Expecting an object', 'pterotype' )
);
}
if ( !array_key_exists( 'actor', $activity ) ) {
return new \WP_Error(
'invalid_actor', __( 'Expecting a valid actor', 'activitypub' )
'invalid_actor', __( 'Expecting a valid actor', 'pterotype' )
);
}
$object = $activity['object'];

View File

@ -36,7 +36,7 @@ function get_actor_from_row( $row ) {
return get_user_actor( $user );
case "commenter":
return new \WP_Error(
'not_implemented', __( 'Commenter actors not yet implemented', 'activitypub' )
'not_implemented', __( 'Commenter actors not yet implemented', 'pterotype' )
);
}
}