Index: /trunk/bp-activity/admin/css/admin.css
===================================================================
--- /trunk/bp-activity/admin/css/admin.css	(revision 5395)
+++ /trunk/bp-activity/admin/css/admin.css	(revision 5396)
@@ -1,1 +1,1 @@
-#wp-bp-activities-wrap{padding:5px 0;}#bp-activities{height:120px;}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0;}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center;}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center;}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top;}
+#wp-bp-activities-wrap{padding:5px 0;}#bp-activities{height:120px;}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0;}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center;}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center;}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top;}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px;}
Index: /trunk/bp-activity/admin/css/admin.dev.css
===================================================================
--- /trunk/bp-activity/admin/css/admin.dev.css	(revision 5395)
+++ /trunk/bp-activity/admin/css/admin.dev.css	(revision 5396)
@@ -2,9 +2,7 @@
 	padding: 5px 0;
 }
-
 #bp-activities {
 	height: 120px;
 }
-
 #bp-replyhead {
 	font-size: 1em;
@@ -12,5 +10,4 @@
 	margin: 0;
 }
-
 #bp-replysubmit {
 	margin: 0;
@@ -18,5 +15,4 @@
 	text-align: center;
 }
-
 #bp-replysubmit .error {
 	color: red;
@@ -25,5 +21,4 @@
 	vertical-align: center;
 }
-
 #bp-replysubmit img.waiting {
 	float: right;
@@ -31,2 +26,7 @@
 	vertical-align: top;
 }
+#bp-activities-form .column-response img {
+	float: left;
+	margin-right: 10px;
+	margin-top: 1px;
+}
Index: /trunk/bp-activity/bp-activity-admin.php
===================================================================
--- /trunk/bp-activity/bp-activity-admin.php	(revision 5395)
+++ /trunk/bp-activity/bp-activity-admin.php	(revision 5396)
@@ -148,7 +148,6 @@
 	add_contextual_help( get_current_screen(), '<p>' . __( 'You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions.', 'buddypress' ) . '</p>' .
 		'<p>' . __( 'There are many different types of activities. Some are generated by BuddyPress automatically, and others are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them.', 'buddypress' ) . '</p>' .
-
 		'<p>' . __( 'In the Activity column, above each activity it says &#8220;Submitted on,&#8221; followed by the date and time the activity item was generated on your site. Clicking on the date/time link will take you to that activity on your live site. Hovering over any activity gives you options to reply, edit, spam mark, or delete that activity.', 'buddypress' ) . '</p>' .
-		'<p>' . __( 'In the In Response To column, the text is the name of the user who generated the activity, and a link to the activity on your live site. The small bubble with the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items.', 'buddypress' ) . '</p>'
+		'<p>' . __( "In the In Response To Column, if the activity was in reply to another activity, it shows that activity's author's picture and name, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items.", 'buddypress' ) . '</p>'
 	);
 
@@ -163,5 +162,5 @@
 	// Enqueue CSS and JavaScript
 	wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$dev}js", array( 'jquery', 'wp-ajax-response' ), '20111120' );
-	wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$dev}css", array(), '20111120' );
+	wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$dev}css", array(), '20111126' );
 
 	// Create the Activity screen list table
@@ -399,4 +398,11 @@
 	 */
 	public $spam_count = 0;
+
+	/**
+	 * Store activity-to-user-ID mappings for use in the In Response To column.
+	 *
+	 * @since 1.6
+	 */
+	protected $activity_user_id = array();
 
 	/**
@@ -488,6 +494,10 @@
 		// bp_activity_get returns an array of objects; cast these to arrays for WP_List_Table.
 		$new_activities = array();
-		foreach ( $activities['activities'] as $activity_item )
+		foreach ( $activities['activities'] as $activity_item ) {
 			$new_activities[] = (array) $activity_item;
+
+			// Build an array of activity-to-user ID mappings for better efficency in the In Response To column
+			$this->activity_user_id[$activity_item->id] = $activity_item->user_id;
+		}
 
 		// @todo If we're viewing a specific activity, check/merge $activity->children into the main list (recursive).
@@ -796,49 +806,65 @@
 	 */
 	function column_response( $item ) {
-		// Display link to user's profile
-		echo bp_core_get_userlink( $item['user_id'] );
-
 		// Get activity permalink
 		$activity_link = bp_activity_get_permalink( $item['id'], (object) $item );
 
-		// Get the root activity ID by parsing the permalink; this may be not be the same as $item['id'] for nested items (e.g. activity_comments)
-		$root_activity_id = array();
-		preg_match( '/\/p\/(\d+)\/*$/i', $activity_link, $root_activity_id );
-		if ( empty( $root_activity_id[1] ) )
-			return;
-
-		$root_activity_id  = (int) $root_activity_id[1];
+		// Get the root activity ID; this may be not be the same as $item['id'] for nested items (e.g. activity_comments)
+		$is_root_activity  = empty( $item['item_id'] );
+		$root_activity_id  = $is_root_activity ? $item['id'] : $item['item_id'];
 		$root_activity_url = network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $root_activity_id );
 
-		// Is $item the root activity?
-		if ( (int) $item['id'] == $root_activity_id ) {
-			$root_activity = (object) $item;
-
-			// Get root activity comment count
-			$comment_count = !empty( $root_activity->children ) ? number_format_i18n( bp_activity_recurse_comment_count( $root_activity ) ) : 0;
-			$title_attr    = sprintf( __( '%s related activities', 'buddypress' ), $comment_count );
-
-			// Display a link to the root activity's permalink, with its comment count in a speech bubble
-			printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', $root_activity_url, esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
-
-		// $item is not the root activity (it is probably an activity_comment).
+		// Get comment count
+		if ( $is_root_activity )
+			$comment_count = !empty( $item['children'] ) ? bp_activity_recurse_comment_count( (object) $item ) : 0;
+		else
+			$comment_count = count( BP_Activity_Activity::get_child_comments( $item['id'] ) );
+
+		if ( ! $is_root_activity ) {
+			// Display link to the replied-to activity's author's profile
+			echo '<strong>' . get_avatar( $this->get_activity_user_id( $item['item_id'] ), '32' ) . ' ' . bp_core_get_userlink( $this->get_activity_user_id( $item['item_id'] ) ) . '</strong><br />';
+		}
+
+		// If the activity has comments, display a link to the root activity's permalink, with its comment count in a speech bubble
+		if ( $comment_count ) {
+			$title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) );
+			printf( '<a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', $root_activity_url, esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
+		}
+
+		// Activity permalink
+		printf( __( '<a href="%1$s">View Activity</a>', 'buddypress' ), bp_activity_get_permalink( $item['id'], (object) $item ) );
+	}
+
+	/**
+	 * A wrapper function for the BP_Activity_List_Table to get the specified activity's user ID.
+	 *
+	 * @param int $activity_id Activity ID to retrieve User ID for
+	 * @since 1.6
+	 */
+	protected function get_activity_user_id( $activity_id ) {
+		// If there is an existing activity/user ID mapping, just return the user ID.
+		if ( ! empty( $this->activity_user_id[$activity_id] ) ) {
+			return $this->activity_user_id[$activity_id];
+
+		/**
+		 * We don't have a mapping. This means the $activity_id is not on the current
+		 * page of results, so fetch its details from the database.
+		 */
 		} else {
-			$comment_count = count( BP_Activity_Activity::get_child_comments( $item['id'] ) );
-
-			// If a non-root activity has zero (child) comments, then don't show a zero bubble to keep the UI tidy
-			if ( 0 == $comment_count ) {
-				echo '<br />';
-
-			} else {
-				$comment_count = number_format_i18n( $comment_count );
-				$title_attr    = sprintf( __( '%s related activities', 'buddypress' ), $comment_count );
-
-				// Display a link to the root activity's permalink, with the current activity's (child) comment count in a speech bubble
-				printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', $root_activity_url, esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
-			}
+			$activity = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'show_hidden' => true, 'spam' => 'all', ) );
+
+			/**
+			 * If, somehow, the referenced activity has been deleted, leaving its associated
+			 * activites as orphans, use the logged in user's ID to avoid errors.
+			 */
+			if ( empty( $activity['activities'] ) )
+				return bp_loggedin_user_id();
+
+			// Store the new activity/user ID mapping for any later re-use
+			$this->activity_user_id[ $activity['activities'][0]->id ] = $activity['activities'][0]->user_id;
+
+			// Return the user ID
+			return $activity['activities'][0]->user_id;
 		}
-
-		// Link to the activity permalink
-		printf( __( '<a href="%1$s">View Activity</a>', 'buddypress' ), bp_activity_get_permalink( $item['id'], (object) $item ) );
-	}
-}?>
+	}
+}
+?>
Index: /trunk/bp-activity/bp-activity-screens.php
===================================================================
--- /trunk/bp-activity/bp-activity-screens.php	(revision 5395)
+++ /trunk/bp-activity/bp-activity-screens.php	(revision 5396)
@@ -195,5 +195,5 @@
 
 	// Get the activity details
-	$activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'hide_spam' => true, 'show_hidden' => true ) );
+	$activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'show_hidden' => true, 'spam' => 'ham_only', ) );
 
 	// 404 if activity does not exist
