Skip to:
Content

BuddyPress.org

Changeset 2817


Ignore:
Timestamp:
03/08/2010 03:20:50 PM (14 years ago)
Author:
apeatling
Message:

Fixes #2090

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-friends.php

    r2794 r2817  
    9999
    100100    // Delete any friendship acceptance notifications for the user when viewing a profile
    101     bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'friends', 'friendship_accepted' );
     101    bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_accepted' );
    102102
    103103    do_action( 'friends_screen_my_friends' );
     
    133133
    134134    do_action( 'friends_screen_requests' );
     135
     136    if ( isset( $_GET['new'] ) )
     137        bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_request' );
    135138
    136139    bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) );
     
    318321        case 'friendship_request':
    319322            if ( (int)$total_items > 1 ) {
    320                 return apply_filters( 'bp_friends_multiple_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have %d pending friendship requests', 'buddypress' ), (int)$total_items ) . '</a>', $total_items );
     323                return apply_filters( 'bp_friends_multiple_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests/?new" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have %d pending friendship requests', 'buddypress' ), (int)$total_items ) . '</a>', $total_items );
    321324            } else {
    322325                $user_fullname = bp_core_get_user_displayname( $item_id );
    323326                $user_url = bp_core_get_user_domain( $item_id );
    324                 return apply_filters( 'bp_friends_single_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have a friendship request from %s', 'buddypress' ), $user_fullname ) . '</a>', $user_fullname );
     327                return apply_filters( 'bp_friends_single_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests/?new" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have a friendship request from %s', 'buddypress' ), $user_fullname ) . '</a>', $user_fullname );
    325328            }
    326329        break;
     
    363366        if ( !$force_accept ) {
    364367            // Add the on screen notification
    365             bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, 'friends', 'friendship_request' );
     368            bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request' );
    366369
    367370            // Send the email notification
     
    409412
    410413        /* Remove the friend request notice */
    411         bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, 'friends', 'friendship_request' );
     414        bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
    412415
    413416        /* Add a friend accepted notice for the initiating user */
    414         bp_core_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, 'friends', 'friendship_accepted' );
     417        bp_core_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_accepted' );
    415418
    416419        $initiator_link = bp_core_get_userlink( $friendship->initiator_user_id );
     
    450453    if ( !$friendship->is_confirmed && BP_Friends_Friendship::reject( $friendship_id ) ) {
    451454        // Remove the friend request notice
    452         bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, 'friends', 'friendship_request' );
     455        bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
    453456
    454457        do_action( 'friends_friendship_rejected', $friendship_id, &$friendship );
     
    598601
    599602    /* Remove friendship requests FROM user */
    600     bp_core_delete_notifications_from_user( $user_id, $bp->friends->slug, 'friendship_request' );
     603    bp_core_delete_notifications_from_user( $user_id, $bp->friends->id, 'friendship_request' );
    601604
    602605    do_action( 'friends_remove_data', $user_id );
     
    632635
    633636    if ( isset($_GET['new']) )
    634         bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'friends', 'friendship_accepted' );
     637        bp_core_delete_notifications_for_user_by_type( $bp->displayed_user->id, $bp->friends->id, 'friendship_accepted' );
    635638}
    636639add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
Note: See TracChangeset for help on using the changeset viewer.