Index: buddypress/bp-themes/bp-default/members/single/member-header.php
===================================================================
--- /buddypress/bp-themes/bp-default/members/single/member-header.php	(revision 3220)
+++ /buddypress/bp-themes/bp-default/members/single/member-header.php	(working copy)
@@ -21,21 +21,35 @@
 		<?php endif; ?>
 
 		<div id="item-buttons">
-			<?php if ( function_exists( 'bp_add_friend_button' ) ) : ?>
-				<?php bp_add_friend_button() ?>
-			<?php endif; ?>
+			<?php if ( function_exists( 'bp_add_friend_button' ) ) :
+				list( $button, $potential_friend_id, $friend_status ) = bp_add_friend_button();
+			
+				if ( $button != false ) { ?>
+					<div class="generic-button friendship-button <?php echo $friend_status ?>" id="friendship-button-<?php echo $potential_friend_id ?>">
+						<?php echo $button ?>
+					</div>
+				<?php };
+			endif; ?>
 
-			<?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_public_message_link' ) ) : ?>
-				<div class="generic-button" id="post-mention">
-					<a href="<?php bp_send_public_message_link() ?>" title="<?php _e( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ) ?>"><?php _e( 'Mention this User', 'buddypress' ) ?></a>
-				</div>
-			<?php endif; ?>
-
-			<?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_private_message_link' ) ) : ?>
-				<div class="generic-button" id="send-private-message">
-					<a href="<?php bp_send_private_message_link() ?>" title="<?php _e( 'Send a private message to this user.', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a>
-				</div>
-			<?php endif; ?>
+			<?php if ( function_exists( 'bp_send_public_message_link' ) ) :
+				$button = bp_send_public_message_link();
+			
+				if ( $button != false ) { ?>
+					<div class="generic-button" id="post-mention">
+						<a href="<?php echo $button ?>" title="<?php _e( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ) ?>"><?php _e( 'Mention this User', 'buddypress' ) ?></a>
+					</div>
+				<?php };
+			endif; ?>
+			
+			<?php if ( function_exists( 'bp_send_private_message_link' ) ) :
+				$button = bp_send_private_message_link();
+			
+				if ( $button != false ) { ?>
+					<div class="generic-button" id="send-private-message">
+						<a href="<?php echo $button ?>" title="<?php _e( 'Send a private message to this user.', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a>
+					</div>
+				<?php };
+			endif; ?>
 		</div><!-- #item-buttons -->
 
 		<?php
Index: buddypress/bp-friends/bp-friends-templatetags.php
===================================================================
--- /buddypress/bp-friends/bp-friends-templatetags.php	(revision 3220)
+++ /buddypress/bp-friends/bp-friends-templatetags.php	(working copy)
@@ -115,39 +115,34 @@
 }
 
 function bp_add_friend_button( $potential_friend_id = false, $friend_status = false ) {
-	echo bp_get_add_friend_button( $potential_friend_id, $friend_status );
-}
-	function bp_get_add_friend_button( $potential_friend_id = false, $friend_status = false ) {
-		global $bp, $friends_template;
+	global $bp, $friends_template;
 
-		if ( !is_user_logged_in() )
-			return false;
+	if ( !is_user_logged_in() )
+		return false;
 
-		if ( !$potential_friend_id && $friends_template->friendship->friend )
-			$potential_friend_id = $friends_template->friendship->friend->id;
-		else if ( !$potential_friend_id && !$friends_template->friendship->friend )
-			$potential_friend_id = $bp->displayed_user->id;
+	if ( !$potential_friend_id && $friends_template->friendship->friend )
+		$potential_friend_id = $friends_template->friendship->friend->id;
+	else if ( !$potential_friend_id && !$friends_template->friendship->friend )
+		$potential_friend_id = $bp->displayed_user->id;
 
-		if ( $bp->loggedin_user->id == $potential_friend_id )
-			return false;
+	if ( $bp->loggedin_user->id == $potential_friend_id )
+		return false;
 
-		if ( empty( $friend_status ) )
-			$friend_status = friends_check_friendship_status( $bp->loggedin_user->id, $potential_friend_id );
+	if ( empty( $friend_status ) )
+		$friend_status = friends_check_friendship_status( $bp->loggedin_user->id, $potential_friend_id );
 
-		$button = '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">';
-
-		if ( 'pending' == $friend_status )
-			$button .= '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
-		else if ( 'is_friend' == $friend_status )
-			$button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>';
-		else
-			$button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>';
-
-		$button .= '</div>';
-
-		return apply_filters( 'bp_get_add_friend_button', $button, $potential_friend_id, $friend_status );
+	if ( 'pending' == $friend_status ) {
+		$button = '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
+	} else if ( 'is_friend' == $friend_status ) {
+		$button = '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>';
+	} else {
+		$button = '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>';
 	}
+	
+	return apply_filters( 'bp_get_add_friend_button', array( $button, $potential_friend_id, $friend_status ) );
 
+}
+
 function bp_get_friend_ids( $user_id = false ) {
 	global $bp;
 
Index: buddypress/bp-activity/bp-activity-templatetags.php
===================================================================
--- /buddypress/bp-activity/bp-activity-templatetags.php	(revision 3220)
+++ /buddypress/bp-activity/bp-activity-templatetags.php	(working copy)
@@ -911,13 +911,16 @@
 	}
 
 function bp_send_public_message_link() {
-	echo bp_get_send_public_message_link();
-}
-	function bp_get_send_public_message_link() {
-		global $bp;
+	global $bp;
+	
+	if ( is_user_logged_in() && !bp_is_my_profile() ) {
 
-		return apply_filters( 'bp_get_send_public_message_link', $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
+		$button = wp_nonce_url( $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
+
+		return apply_filters( 'bp_get_send_public_message_link', $button );
 	}
+	return;
+}
 
 function bp_activity_post_form_action() {
 	echo bp_get_activity_post_form_action();
Index: buddypress/bp-messages/bp-messages-templatetags.php
===================================================================
--- /buddypress/bp-messages/bp-messages-templatetags.php	(revision 3220)
+++ /buddypress/bp-messages/bp-messages-templatetags.php	(working copy)
@@ -492,13 +492,16 @@
 }
 
 function bp_send_private_message_link() {
-	echo bp_get_send_private_message_link();
-}
-	function bp_get_send_private_message_link() {
-		global $bp;
+	global $bp;
+	
+	if ( is_user_logged_in() && !bp_is_my_profile() ) {
+		
+		$button = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
 
-		return apply_filters( 'bp_get_send_private_message_link', $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
+		return apply_filters( 'bp_get_send_private_message_link', $button );
 	}
+	return;
+}
 
 function bp_send_message_button() {
 	echo bp_get_send_message_button();
