From db59ae8cf86e4af8c416d9b0b790f1a459d7f3da Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sat, 25 Aug 2018 09:31:20 -0400 Subject: [PATCH] Sketch out handle_activity --- inc/outbox.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/inc/outbox.php b/inc/outbox.php index 71d19e9..ff004b4 100644 --- a/inc/outbox.php +++ b/inc/outbox.php @@ -42,5 +42,32 @@ function create_activity( $actor, $activity ) { // TODO set location header of response to created object URL return $response; } + +function handle_activity( $actor, $activity ) { + if ( !array_key_exists( "type", $activity ) ) { + return new WP_Error( + 'invalid_activity', 'Invalid activity', array( 'status' => 400 ) + ); + } + switch ( $activity["type"] ) { + case "Create": + break; + case "Update": + break; + case "Delete": + break; + case "Follow": + break; + case "Add": + break; + case "Remove": + break; + case "Like": + break; + case "Block": + break; + case "Undo": + break; + } } ?>