Skip to:
Content

BuddyPress.org

Ticket #7907: 7907.01.patch

File 7907.01.patch, 2.1 KB (added by r-a-y, 8 years ago)
  • src/bp-activity/bp-activity-notifications.php

     
    5555                                $text   = sprintf( __( 'You have %1$d new replies', 'buddypress' ), (int) $total_items );
    5656                                $amount = 'multiple';
    5757                        } else {
    58                                 $link = add_query_arg( 'nid', (int) $id, bp_activity_get_permalink( $activity_id ) );
     58                                $link = add_query_arg( 'rid', (int) $id, bp_activity_get_permalink( $activity_id ) );
    5959                                $text = sprintf( __( '%1$s commented on one of your updates', 'buddypress' ), $user_fullname );
    6060                        }
    6161                break;
     
    7070                                $text   = sprintf( __( 'You have %1$d new comment replies', 'buddypress' ), (int) $total_items );
    7171                                $amount = 'multiple';
    7272                        } else {
    73                                 $link = add_query_arg( 'nid', (int) $id, bp_activity_get_permalink( $activity_id ) );
    74                                 $text = sprintf( __( '%1$s replied to one your activity comments', 'buddypress' ), $user_fullname );
     73                                $link = add_query_arg( 'crid', (int) $id, bp_activity_get_permalink( $activity_id ) );
     74                                $text = sprintf( __( '%1$s replied to one of your activity comments', 'buddypress' ), $user_fullname );
    7575                        }
    7676                break;
    7777        }
     
    239239
    240240        // Mark as read any notifications for the current user related to this activity item.
    241241        bp_notifications_mark_notifications_by_item_id( bp_loggedin_user_id(), $activity->id, buddypress()->activity->id, 'new_at_mention' );
     242
     243        // For replies to a parent update.
     244        if ( ! empty( $_GET['rid'] ) ) {
     245                BP_Notifications_Notification::update(
     246                        array(
     247                                'is_new' => false
     248                        ),
     249                        array(
     250                                'user_id' => bp_loggedin_user_id(),
     251                                'id'      => (int) $_GET['rid'],
     252                        )
     253                );
     254        }
     255
     256        // For replies to an activity comment.
     257        if ( ! empty( $_GET['crid'] ) ) {
     258                BP_Notifications_Notification::update(
     259                        array(
     260                                'is_new' => false
     261                        ),
     262                        array(
     263                                'user_id' => bp_loggedin_user_id(),
     264                                'id'      => (int) $_GET['crid'],
     265                        )
     266                );
     267        }
    242268}
    243269add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications_single_activity_permalink' );
    244270