From d133be2e155dbcf08b8c2e8665d6a5155304d80a Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Tue, 23 Oct 2018 07:02:57 -0400 Subject: [PATCH] [WIP] Start implementing outbound comments --- includes/client/comments.php | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 includes/client/comments.php diff --git a/includes/client/comments.php b/includes/client/comments.php new file mode 100644 index 0000000..88eabfa --- /dev/null +++ b/includes/client/comments.php @@ -0,0 +1,65 @@ +set_method( 'POST' ); + $request->set_body( wp_json_encode( $activity ) ); + $request->add_header( 'Content-Type', 'application/ld+json' ); + $server->dispatch( $request ); + } +} + +function get_comment_actor_slug( $comment ) { + if ( $comment->user_id !== 0 ) { + return get_comment_user_actor_slug( $comment->user_id ); + } else { + return get_comment_email_actor_slug( $comment->comment_author_email ); + } +} + +function get_comment_user_actor_slug( $user_id ) { + +} + +function get_comment_email_actor_slug( $email_address ) { + +} + +function comment_to_object( $comment ) { + +} + +function get_comment_to( $comment, $followers_id ) { + $to = array( + 'https://www.w3.org/ns/activitystreams#Public', + $followers_id, + ); + // TODO traverse comment reply chain to retrieve others to address to + return $to; +} +?>