rename get_id method to generate_id

This commit is contained in:
Django Doucet 2023-11-04 00:03:42 -06:00
parent 3c089a6549
commit 15555bdd31

View file

@ -63,7 +63,7 @@ class Comment {
$comment = $this->wp_comment; $comment = $this->wp_comment;
$object = new Base_Object(); $object = new Base_Object();
$object->set_id( $this->get_id( $comment ) ); $object->set_id( $this->generate_id( $comment ) );
$object->set_url( \get_comment_link( $comment->ID ) ); $object->set_url( \get_comment_link( $comment->ID ) );
$object->set_type( 'Note' ); $object->set_type( 'Note' );
@ -148,7 +148,7 @@ class Comment {
$in_reply_to = $this->get_source_id( $parent_comment ); $in_reply_to = $this->get_source_id( $parent_comment );
if ( ! $in_reply_to ) { if ( ! $in_reply_to ) {
//local //local
$in_reply_to = $this->get_id( $parent_comment ); $in_reply_to = $this->generate_id( $parent_comment );
} }
} else { } else {
$pretty_permalink = \get_post_meta( $comment->comment_post_ID, 'activitypub_canonical_url', true ); $pretty_permalink = \get_post_meta( $comment->comment_post_ID, 'activitypub_canonical_url', true );
@ -170,7 +170,7 @@ class Comment {
* https://www.w3.org/TR/activitypub/#obj-id * https://www.w3.org/TR/activitypub/#obj-id
* https://github.com/tootsuite/mastodon/issues/13879 * https://github.com/tootsuite/mastodon/issues/13879
*/ */
protected function get_id( $comment ) { protected function generate_id( $comment ) {
$comment = \get_comment( $comment ); $comment = \get_comment( $comment );
$ap_comment_id = \add_query_arg( $ap_comment_id = \add_query_arg(