From 0dc4e5aba91fe6af64d90d4c13d2a214e0b98766 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 27 Aug 2018 18:36:18 -0400 Subject: [PATCH] WIP --- inc/activities/create.php | 50 +++++++++++++++++++++++++++++++++++++++ inc/outbox.php | 7 +++++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 inc/activities/create.php diff --git a/inc/activities/create.php b/inc/activities/create.php new file mode 100644 index 0000000..f44893a --- /dev/null +++ b/inc/activities/create.php @@ -0,0 +1,50 @@ + diff --git a/inc/outbox.php b/inc/outbox.php index e8f6119..a03f34f 100644 --- a/inc/outbox.php +++ b/inc/outbox.php @@ -46,7 +46,9 @@ function persist_activity( $actor, $activity ) { function handle_activity( $actor, $activity ) { if ( !array_key_exists( "type", $activity ) ) { return new WP_Error( - 'invalid_activity', 'Invalid activity', array( 'status' => 400 ) + 'invalid_activity', + __( 'Invalid activity', 'activitypub' ), + array( 'status' => 400 ) ); } switch ( $activity["type"] ) { @@ -68,6 +70,9 @@ function handle_activity( $actor, $activity ) { break; case "Undo": break; + default: + // handle wrapping object in Create activity + break; } } ?>