diff --git a/includes/class-activitypub.php b/includes/class-activitypub.php index 8640d68..68dabdd 100644 --- a/includes/class-activitypub.php +++ b/includes/class-activitypub.php @@ -97,12 +97,12 @@ class Activitypub { */ public static function add_query_vars( $vars ) { $vars[] = 'activitypub'; - $vars[] = 'ap_comment_id';//comment_id doesn't work, 'c' is probably too short and prone to collisions + $vars[] = 'replytocom'; //Collections review $vars[] = 'replies'; $vars[] = 'collection_page'; - $vars[] = 'only_other_accounts'; + //$vars[] = 'only_other_accounts'; return $vars; } diff --git a/includes/functions.php b/includes/functions.php index c331246..8f5108e 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -374,9 +374,9 @@ function url_to_commentid( $in_replyto_url ) { if ( site_url() === $url_maybe_id['scheme'] . '://' . $url_maybe_id['host'] && ! empty( $url_maybe_id['query'] ) ) { //is local post or comment \parse_str( $url_maybe_id['query'], $reply_query ); - if ( isset( $reply_query['ap_comment_id'] ) ) { + if ( isset( $reply_query['replytocom'] ) ) { //is local comment - return $reply_query['ap_comment_id']; + return $reply_query['replytocom']; } } else { //is remote url @@ -409,7 +409,7 @@ function url_to_commentid( $in_replyto_url ) { * @return int comment_id */ function is_ap_comment() { - $comment_id = get_query_var( 'ap_comment_id', null ); + $comment_id = get_query_var( 'replytocom', null ); if ( ! is_null( $comment_id ) ) { $comment = \get_comment( $comment_id ); // Only return local origin comments @@ -561,7 +561,7 @@ function set_ap_comment_id( $comment ) { $ap_comment_id = \add_query_arg( array( 'p' => $comment->comment_post_ID, - 'ap_comment_id' => $comment->comment_ID, + 'replytocom' => $comment->comment_ID, ), \trailingslashit( site_url() ) ); diff --git a/includes/model/class-comment.php b/includes/model/class-comment.php index 0ac697a..cf36207 100644 --- a/includes/model/class-comment.php +++ b/includes/model/class-comment.php @@ -110,14 +110,14 @@ class Comment { $in_reply_to = add_query_arg( array( 'p' => $comment->comment_post_ID, - 'ap_comment_id' => $comment->comment_parent, + 'replytocom' => $comment->comment_parent, ), trailingslashit( site_url() ) ); } } else { //parent is_post // Backwards compatibility - $pretty_permalink = \get_post_meta( $comment->comment_post_ID, '_activitypub_permalink_compat', true ); // TODO finalize meta + $pretty_permalink = \get_post_meta( $comment->comment_post_ID, '_activitypub_permalink_compat', true ); if ( $pretty_permalink ) { $in_reply_to = $pretty_permalink; } else { @@ -259,7 +259,7 @@ class Comment { $comment_url = \add_query_arg( // array( 'p' => $comment->comment_post_ID, - 'ap_comment_id' => $comment->comment_ID, + 'replytocom' => $comment->comment_ID, ), trailingslashit( site_url() ) ); diff --git a/includes/model/class-post.php b/includes/model/class-post.php index e82d376..302a002 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -199,7 +199,7 @@ class Post { $comment_url = \add_query_arg( // array( 'p' => $this->post->ID, - 'ap_comment_id' => $comment->comment_ID, + 'replytocom' => $comment->comment_ID, ), trailingslashit( site_url() ) ); diff --git a/templates/comment-json.php b/templates/comment-json.php index 1749620..b3d3223 100644 --- a/templates/comment-json.php +++ b/templates/comment-json.php @@ -1,5 +1,5 @@ \Activitypub\get_context() ), $activitypub_comment->to_array() ); diff --git a/templates/replies-json.php b/templates/replies-json.php index 6135ad8..574eb72 100644 --- a/templates/replies-json.php +++ b/templates/replies-json.php @@ -14,7 +14,7 @@ $args = array( $comments = get_comments( $args ); $replies_request = \add_query_arg( $_SERVER['QUERY_STRING'], '', $post->guid ); -$collection_id = \remove_query_arg(['page', 'ap_comment_id'], $replies_request ); +$collection_id = \remove_query_arg(['page', 'replytocom'], $replies_request ); $json = new \stdClass(); $json->{'@context'} = 'https://www.w3.org/ns/activitystreams';