Skip to:
Content

BuddyPress.org

Changeset 3172


Ignore:
Timestamp:
08/10/2010 12:26:35 AM (14 years ago)
Author:
johnjamesjacoby
Message:

When friendship is accepted, include alternate user_id in secondary_item_id.

File:
1 edited

Legend:

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

    r3145 r3172  
    416416        friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id );
    417417
    418         /* Remove the friend request notice */
     418        // Remove the friend request notice
    419419        bp_core_delete_notifications_for_user_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
    420420
    421         /* Add a friend accepted notice for the initiating user */
     421        // Add a friend accepted notice for the initiating user
    422422        bp_core_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_accepted' );
    423423
     
    425425        $friend_link = bp_core_get_userlink( $friendship->friend_user_id );
    426426
    427         /* Record in activity streams for the initiator */
     427        // Record in activity streams for the initiator
    428428        friends_record_activity( array(
    429             'user_id' => $friendship->initiator_user_id,
    430             'type' => 'friendship_created',
    431             'action' => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%s and %s are now friends', 'buddypress' ), $initiator_link, $friend_link ), &$friendship ),
    432             'item_id' => $friendship_id
     429            'user_id'           => $friendship->initiator_user_id,
     430            'type'              => 'friendship_created',
     431            'action'            => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%s and %s are now friends', 'buddypress' ), $initiator_link, $friend_link ), &$friendship ),
     432            'item_id'           => $friendship_id,
     433            'secondary_item_id' => $friendship->friend_user_id
    433434        ) );
    434435
    435         /* Record in activity streams for the friend */
     436        // Record in activity streams for the friend
    436437        friends_record_activity( array(
    437             'user_id' => $friendship->friend_user_id,
    438             'type' => 'friendship_created',
    439             'action' => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%s and %s are now friends', 'buddypress' ), $friend_link, $initiator_link ), &$friendship ),
    440             'item_id' => $friendship_id,
    441             'hide_sitewide' => true /* We've already got the first entry site wide */
     438            'user_id'           => $friendship->friend_user_id,
     439            'type'              => 'friendship_created',
     440            'action'            => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%s and %s are now friends', 'buddypress' ), $friend_link, $initiator_link ), &$friendship ),
     441            'item_id'           => $friendship_id,
     442            'secondary_item_id' => $friendship->initiator_user_id,
     443            'hide_sitewide'     => true // We've already got the first entry site wide
    442444        ) );
    443445
    444         /* Send the email notification */
     446        // Send the email notification
    445447        require_once( BP_PLUGIN_DIR . '/bp-friends/bp-friends-notifications.php' );
    446448        friends_notification_accepted_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
Note: See TracChangeset for help on using the changeset viewer.