Skip to:
Content

BuddyPress.org

Ticket #3296: 3296.001.patch

File 3296.001.patch, 1.4 KB (added by r-a-y, 15 years ago)
  • bp-activity/bp-activity-functions.php

     
    6767                        $new_mention_count = (int)get_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mention_count' ), true );
    6868                        if ( !$new_mentions = get_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mentions' ), true ) )
    6969                                $new_mentions = array();
    70                                
     70
    7171                        switch ( $action ) {
    7272                                case 'delete' :
    7373                                        $key = array_search( $activity_id, $new_mentions );
     
    7575                                                unset( $new_mentions[$key] );
    7676                                        }
    7777                                        break;
    78                                
     78
    7979                                case 'add' :
    8080                                default :
    8181                                        if ( !in_array( $activity_id, $new_mentions ) ) {
     
    8383                                        }
    8484                                        break;
    8585                        }
    86                        
    87                         // Get an updated mention count                 
     86
     87                        // Get an updated mention count
    8888                        $new_mention_count = count( $new_mentions );
    89                        
     89
    9090                        // Resave the user_meta
    9191                        update_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mention_count' ), $new_mention_count );
    9292                        update_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mentions' ), $new_mentions );
     
    890890                        $link = bp_get_root_domain() . '/' . $bp->activity->root_slug . '/p/' . $activity_obj->id . '/';
    891891        }
    892892
    893         return apply_filters( 'bp_activity_get_permalink', $link );
     893        return apply_filters_ref_array( 'bp_activity_get_permalink', array( $link, &$activity_obj ) );
    894894}
    895895
    896896function bp_activity_hide_user_activity( $user_id ) {