updated plugin ActivityPub version 9.1.0
This commit is contained in:
@ -59,7 +59,7 @@ class Mailer {
|
||||
$post = \get_post( $comment->comment_post_ID );
|
||||
|
||||
/* translators: 1: Blog name, 2: Like or Repost, 3: Post title */
|
||||
return \sprintf( \esc_html__( '[%1$s] %2$s: %3$s', 'activitypub' ), \esc_html( get_option( 'blogname' ) ), \esc_html( $singular ), \esc_html( $post->post_title ) );
|
||||
return \sprintf( \esc_html__( '[%1$s] %2$s: %3$s', 'activitypub' ), \esc_html( \get_option( 'blogname' ) ), \esc_html( $singular ), \esc_html( $post->post_title ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -101,7 +101,7 @@ class Mailer {
|
||||
if ( 0 === (int) $comment->comment_parent ) {
|
||||
$notify_message = \sprintf(
|
||||
/* translators: 1: Comment type, 2: Post title */
|
||||
\html_entity_decode( esc_html__( 'New %1$s on your post “%2$s”.', 'activitypub' ) ),
|
||||
\html_entity_decode( \esc_html__( 'New %1$s on your post “%2$s”.', 'activitypub' ) ),
|
||||
\esc_html( $comment_type['singular'] ),
|
||||
\esc_html( $post->post_title )
|
||||
) . PHP_EOL . PHP_EOL;
|
||||
@ -110,7 +110,7 @@ class Mailer {
|
||||
$parent_comment = \get_comment( $comment->comment_parent );
|
||||
$notify_message = \sprintf(
|
||||
/* translators: 1: Comment type, 2: Post title, 3: Parent comment author */
|
||||
\html_entity_decode( esc_html__( 'New %1$s on your post “%2$s” in reply to %3$s’s comment.', 'activitypub' ) ),
|
||||
\html_entity_decode( \esc_html__( 'New %1$s on your post “%2$s” in reply to %3$s’s comment.', 'activitypub' ) ),
|
||||
\esc_html( $comment_type['singular'] ),
|
||||
\esc_html( $post->post_title ),
|
||||
\esc_html( $parent_comment->comment_author )
|
||||
@ -120,7 +120,19 @@ class Mailer {
|
||||
/* translators: 1: Website name, 2: Website IP address, 3: Website hostname. */
|
||||
$notify_message .= \sprintf( \esc_html__( 'From: %1$s (IP address: %2$s, %3$s)', 'activitypub' ), \esc_html( $comment->comment_author ), \esc_html( $comment->comment_author_IP ), \esc_html( $comment_author_domain ) ) . "\r\n";
|
||||
/* translators: Reaction author URL. */
|
||||
$notify_message .= \sprintf( \esc_html__( 'URL: %s', 'activitypub' ), \esc_url( $comment->comment_author_url ) ) . "\r\n\r\n";
|
||||
$notify_message .= \sprintf( \esc_html__( 'URL: %s', 'activitypub' ), \esc_url( $comment->comment_author_url ) ) . "\r\n";
|
||||
|
||||
// For quotes, link to the quoting post itself so the author can review and respond.
|
||||
if ( 'quote' === $comment->comment_type ) {
|
||||
$quote_url = Comment::get_source_url( $comment->comment_ID );
|
||||
|
||||
if ( $quote_url ) {
|
||||
/* translators: Quoting post URL. */
|
||||
$notify_message .= \sprintf( \esc_html__( 'Quoting post: %s', 'activitypub' ), \esc_url( $quote_url ) ) . "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
$notify_message .= "\r\n";
|
||||
/* translators: Comment type label */
|
||||
$notify_message .= \sprintf( \esc_html__( 'You can see all %s on this post here:', 'activitypub' ), \esc_html( $comment_type['label'] ) ) . "\r\n";
|
||||
$notify_message .= \get_permalink( $comment->comment_post_ID ) . '#' . \esc_attr( $comment_type['type'] ) . "\r\n\r\n";
|
||||
@ -144,11 +156,6 @@ class Mailer {
|
||||
// Extract the user ID (follows are always for a single user).
|
||||
$user_id = \is_array( $user_ids ) ? \reset( $user_ids ) : $user_ids;
|
||||
|
||||
// Do not send notifications to the Application user.
|
||||
if ( Actors::APPLICATION_USER_ID === $user_id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $user_id > Actors::BLOG_USER_ID ) {
|
||||
if ( ! \get_user_option( 'activitypub_mailer_new_follower', $user_id ) ) {
|
||||
return;
|
||||
@ -180,7 +187,7 @@ class Mailer {
|
||||
$actor['summary'] = Emoji::replace_for_actor( $actor['summary'], $actor['url'] );
|
||||
}
|
||||
|
||||
$template_args = array_merge(
|
||||
$template_args = \array_merge(
|
||||
$actor,
|
||||
array(
|
||||
'admin_url' => $admin_url,
|
||||
@ -305,7 +312,7 @@ class Mailer {
|
||||
$alt_function = static function ( $mailer ) use ( $actor, $activity ) {
|
||||
$content = \html_entity_decode(
|
||||
\wp_strip_all_tags(
|
||||
str_replace( '</p>', PHP_EOL . PHP_EOL, $activity['object']['content'] )
|
||||
\str_replace( '</p>', PHP_EOL . PHP_EOL, $activity['object']['content'] )
|
||||
),
|
||||
ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401
|
||||
);
|
||||
@ -345,8 +352,8 @@ class Mailer {
|
||||
}
|
||||
|
||||
$recipients = array();
|
||||
$mentions = wp_list_filter( (array) $activity['object']['tag'], array( 'type' => 'Mention' ) );
|
||||
$mentions = array_map( '\Activitypub\object_to_uri', $mentions );
|
||||
$mentions = \wp_list_filter( (array) $activity['object']['tag'], array( 'type' => 'Mention' ) );
|
||||
$mentions = \array_map( '\Activitypub\object_to_uri', $mentions );
|
||||
foreach ( (array) $user_ids as $user_id ) {
|
||||
$actor = Actors::get_by_id( $user_id );
|
||||
if ( \is_wp_error( $actor ) ) {
|
||||
@ -405,7 +412,7 @@ class Mailer {
|
||||
$alt_function = static function ( $mailer ) use ( $actor, $activity ) {
|
||||
$content = \html_entity_decode(
|
||||
\wp_strip_all_tags(
|
||||
str_replace( '</p>', PHP_EOL . PHP_EOL, $activity['object']['content'] )
|
||||
\str_replace( '</p>', PHP_EOL . PHP_EOL, $activity['object']['content'] )
|
||||
),
|
||||
ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user