* @global object $bp Global BuddyPress settings object
* @uses bp_activity_add() Adds an entry to the activity component tables for a specific activity
*/
function bp_xprofile_new_avatar_activity() {
global $bp;
if ( !bp_is_active( 'activity' ) )
return false;
$user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', $bp->displayed_user->id );
$userlink = bp_core_get_userlink( $user_id );
bp_activity_add( array(
'user_id' => $user_id,
'action' => apply_filters( 'bp_xprofile_new_avatar_action', sprintf( __( '%s changed their profile picture', 'buddypress' ), $userlink ), $user_id ),
'component' => 'profile',
'type' => 'new_avatar'
) );
}