Skip to:
Content

bbPress.org

Ticket #3341: 3341.2.patch

File 3341.2.patch, 1.6 KB (added by johnjamesjacoby, 4 years ago)
  • src/includes/extend/buddypress/notifications.php

     
    6262function bbp_format_buddypress_notifications( $content, $item_id, $secondary_item_id, $action_item_count, $format, $component_action_name, $component_name, $id ) {
    6363
    6464        // Bail if not the notification action we are looking for
    65         if ( 'bbp_new_reply' !== $component_action_name ) {
     65        if ( 0 !== strpos( $component_action_name, 'bbp_new_reply' ) ) {
    6666                return $content;
    6767        }
    6868
     
    8686        // Multiple
    8787        if ( $action_item_count > 1 ) {
    8888                $filter = 'bbp_multiple_new_subscription_notification';
    89                 $text   = sprintf( esc_html__( 'You have %d new replies', 'bbpress' ), $action_item_count );
     89                $text   = sprintf( esc_html__( 'You have %1$d new replies to %2$s', 'bbpress' ), $action_item_count, $topic_title );
    9090
    9191        // Single
    9292        } else {
     
    148148                'user_id'          => $topic_author_id,
    149149                'item_id'          => $reply_id,
    150150                'component_name'   => bbp_get_component_name(),
    151                 'component_action' => 'bbp_new_reply',
     151                'component_action' => 'bbp_new_reply_' . $topic_id,
    152152                'date_notified'    => get_post( $reply_id )->post_date,
    153153        );
    154154
     
    211211                $component = bbp_get_component_name();
    212212
    213213                // Attempt to clear notifications for this topic
    214                 $marked    = bp_notifications_mark_notifications_by_item_id( $user_id, $topic_id, $component, 'bbp_new_reply' );
     214                $marked    = bp_notifications_mark_notifications_by_type( $user_id, $component, 'bbp_new_reply_' . $topic_id );
    215215
    216216                // Get all reply IDs for the topic
    217217                $replies   = bbp_get_all_child_ids( $topic_id, $post_type );