Skip to content

Commit

Permalink
fix reply-context
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Feb 12, 2024
1 parent 2705703 commit 61b770f
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions includes/transformer/class-comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,22 +247,11 @@ public function extract_reply_context( $mentions ) {

if ( $comment_query->comments ) {
foreach ( $comment_query->comments as $comment ) {
$id = null;
$comment_meta = \get_comment_meta( $comment->comment_ID );

if ( ! empty( $comment_meta['source_id'][0] ) ) {
$id = \esc_url( $comment_meta['source_id'][0] );
} elseif ( ! empty( $comment_meta['source_url'][0] ) ) {
$id = \esc_url( $comment_meta['source_url'][0] );
} elseif ( ! empty( $comment->comment_author_url ) ) {
$id = $comment->comment_author_url;
}

if ( $id ) {
$acct = Webfinger::uri_to_acct( $id );
if ( ! empty( $comment->comment_author_url ) ) {
$acct = Webfinger::uri_to_acct( $comment->comment_author_url );
if ( $acct && ! is_wp_error( $acct ) ) {
$acct = str_replace( 'acct:', '@', $acct );
$mentions[ $acct ] = $id;
$mentions[ $acct ] = $comment->comment_author_url;
}
}
}
Expand Down

0 comments on commit 61b770f

Please sign in to comment.