Index: bp-activity-notifications.php
===================================================================
--- bp-activity-notifications.php	(revision 7685)
+++ bp-activity-notifications.php	(working copy)
@@ -238,6 +238,77 @@
 }
 
 /**
+ * Send email when a blog post receives a comment.
+ *
+ * @since BuddyPress (1.9.0)
+ *
+ * @uses get_comment()
+ * @uses get_post() 
+ * @uses get_permalink()
+ * @uses bp_get_user_meta()
+ * @uses bp_get_settings_slug()
+ * @uses bp_core_get_user_domain()
+ * @uses bp_core_get_core_userdata()
+ * @uses bp_get_email_subject()
+ * @uses wp_mail()
+ * @uses apply_filters() To call the 'bp_blog_post_new_comment_notification_to' hook
+ * @uses apply_filters() To call the 'bp_blog_post_new_comment_notification_subject' hook
+ * @uses apply_filters() To call the 'bp_blog_post_new_comment_notification_message' hook
+ * @uses do_action() To call the 'bp_blog_post_comment_email' hook
+ *
+ * @param int $comment_id The comment id.
+ * @param int $comment_approved 1 (true) if the comment is approved, 0 (false) if not
+ */
+
+function bp_blog_post_new_comment_notification( $comment_ID, $comment_approved ) {
+	
+	$comment = get_comment( $comment_ID );
+	$post = get_post( $comment->comment_post_ID );
+
+	if ( $post->post_author != $comment->user_id && 'no' != bp_get_user_meta( $post->post_author, 'notification_blog_post_new_comment', true ) ) {
+		
+		$post_link   = get_permalink( $post->ID );
+		
+		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+		$settings_link = bp_core_get_user_domain( $post->post_author ) . $settings_slug . '/notifications/';
+
+		$commenter_name = stripslashes( $comment->comment_author );
+		
+		$content = stripslashes( $comment->comment_content );
+
+		// Set up and send the message
+		$ud      = bp_core_get_core_userdata( $post->post_author );
+		$to      = $ud->user_email;
+		$subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s commented on one of your posts', 'buddypress' ), $commenter_name ) ) );
+		$message = sprintf( __(
+'%1$s commented on one of your blog posts:
+
+"%2$s"
+
+To view your blog post and all comments, log in and visit: %3$s
+
+---------------------
+', 'buddypress' ), $commenter_name, $content, $post_link );
+
+		// Only show the disable notifications line if the settings component is enabled
+		if ( bp_is_active( 'settings' ) ) {
+			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
+		}
+
+		/* Send the message */
+		$to = apply_filters( 'bp_blog_post_new_comment_notification_to', $to );
+		$subject = apply_filters( 'bp_blog_post_new_comment_notification_subject', $subject, $commenter_name );
+		$message = apply_filters( 'bp_blog_post_new_comment_notification_message', $message, $commenter_name, $content, $post_link, $settings_link );
+
+		wp_mail( $to, $subject, $message );
+	}
+	
+	do_action( 'bp_blog_post_comment_email', $post->post_author, $subject, $message, $comment_ID, $comment->user_id, $post->ID );
+
+}
+add_action( 'comment_post', 'bp_blog_post_new_comment_notification', 10, 2 );
+
+/**
  * Helper method to map action arguments to function parameters
  *
  * @since BuddyPress (1.9.0)
@@ -254,21 +325,28 @@
 /**
  * Format notifications related to activity.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.9.0)
  *
+ * @uses get_post()
+ * @uses get_author_posts_url()
+ * @uses get_permalink()
  * @uses bp_loggedin_user_domain()
+ * @uses bp_core_get_user_domain()
  * @uses bp_get_activity_slug()
  * @uses bp_core_get_user_displayname()
  * @uses apply_filters() To call the 'bp_activity_multiple_at_mentions_notification' hook.
  * @uses apply_filters() To call the 'bp_activity_single_at_mentions_notification' hook.
- * @uses do_action() To call 'activity_format_notifications' hook.
+ * @uses apply_filters() To call the 'bp_activity_multiple_blog_post_comment_notification' hook.
+ * @uses apply_filters() To call the 'bp_activity_single_blog_post_comment_notification' hook.
+ * @uses do_action() To call 'activity_format_notifications' hook. 
+ * @uses do_action() To call 'blog_post_comment_format_notifications' hook.
  *
- * @param string $action The type of activity item. Just 'new_at_mention' for now.
- * @param int $item_id The activity ID.
+ * @param string $action The type of activity item. 'new_at_mention' or 'new_blog_post_comment'.
+ * @param int $item_id In the case of at-mentions, this is the activity ID. In the case of blog comments, this is the post ID.
  * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID.
  * @param int $total_items The total number of notifications to format.
  * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise.
- * @return string $return Formatted @mention notification.
+ * @return string $return Formatted notification.
  */
 function bp_activity_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
 
@@ -287,20 +365,47 @@
 				$text =  sprintf( __( '%1$s mentioned you', 'buddypress' ), $user_fullname );
 				$filter = 'bp_activity_single_at_mentions_notification';
 			}
+			
+			if ( 'string' == $format ) {
+				$return = apply_filters( $filter, '<a href="' . esc_url( $at_mention_link ) . '" title="' . esc_attr( $at_mention_title ) . '">' . esc_html( $text ) . '</a>', $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
+			} else {
+				$return = apply_filters( $filter, array(
+					'text' => $text,
+					'link' => $at_mention_link
+				), $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
+			}
+			do_action( 'activity_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
 		break;
+		
+		case 'new_blog_post_comment':
+		
+			$post = get_post( $item_id );
+			
+			$author_url = get_author_posts_url( $post->post_author );
+			$post_title = $post->post_title;
+			
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( '%1$d of your posts have new comments', 'buddypress' ), (int) $total_items );
+				$filter = 'bp_activity_multiple_blog_post_comments_notification';
+			} else {
+				$user_fullname = bp_core_get_user_displayname( $secondary_item_id );
+				$text =  sprintf( __( '%1$s commented on one of your posts', 'buddypress' ), $user_fullname );
+				$filter = 'bp_activity_single_blog_post_comments_notification';
+			}
+			
+			if ( 'string' == $format ) {
+				$return = apply_filters( $filter, '<a href="' . esc_url( $author_url ) . '">' . esc_html( $text ) . '</a>', $author_url, (int) $total_items, $item_id, $secondary_item_id );
+			} else {
+				$return = apply_filters( $filter, array(
+					'text' => $text,
+					'link' => $author_url
+				), $author_url, (int) $total_items, $item_id, $secondary_item_id );
+			}
+			
+			do_action( 'blog_post_comment_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
+		break;
 	}
 
-	if ( 'string' == $format ) {
-		$return = apply_filters( $filter, '<a href="' . esc_url( $at_mention_link ) . '" title="' . esc_attr( $at_mention_title ) . '">' . esc_html( $text ) . '</a>', $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
-	} else {
-		$return = apply_filters( $filter, array(
-			'text' => $text,
-			'link' => $at_mention_link
-		), $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
-	}
-
-	do_action( 'activity_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
-
 	return $return;
 }
 
@@ -351,3 +456,52 @@
 add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications' );
 add_action( 'bp_activity_screen_mentions',                  'bp_activity_remove_screen_notifications' );
 
+/**
+ * Notify a member when their blog post receives a comment.
+ *
+ * Hooked to the 'bp_blog_post_comment_email' action, we piggy back off the
+ * existing email code for now, since it does the heavy lifting for us.
+ *
+ * @since BuddyPress (1.9.0)
+ *
+ * @param string $post_author_id
+ * @param string $subject (not used)
+ * @param string $message (not used)
+ * @param string $comment_id (not used)
+ * @param string $commenter_id
+ * @param string $post_id
+ */ 
+
+function bp_blog_post_comment_add_notification( $post_author_id, $subject, $message, $comment_id, $commenter_id, $post_id ) {
+	if ( bp_is_active( 'notifications' ) ) {
+	
+		bp_notifications_add_notification( array(
+			'user_id'           => $post_author_id,
+			'item_id'           => $post_id,
+			'secondary_item_id' => $commenter_id,
+			'component_name'    => buddypress()->activity->id,
+			'component_action'  => 'new_blog_post_comment',
+			'date_notified'     => bp_core_current_time(),
+			'is_new'            => 1,
+		) );
+	}
+}
+add_action( 'bp_blog_post_comment_email', 'bp_blog_post_comment_add_notification', 10, 6 );
+
+/**
+ * Remove blog post notifications when a user clicks on them.
+ *
+ * @since BuddyPress (1.9.0)
+ *
+ * @uses bp_notifications_mark_notifications_by_item_id()
+ * @uses bp_is_active()
+ * @uses is_author()
+ * @uses bp_loggedin_user_id()
+ */ 
+
+function bp_blog_post_comment_remove_screen_notifications() {
+	if ( ( is_author( bp_loggedin_user_id() ) ) && ( bp_is_active( 'notifications' ) ) ) {
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_blog_post_comment' );
+	}
+}
+add_action( 'wp', 'bp_blog_post_comment_remove_screen_notifications' );
\ No newline at end of file
Index: bp-activity-screens.php
===================================================================
--- bp-activity-screens.php	(revision 7685)
+++ bp-activity-screens.php	(working copy)
@@ -298,6 +298,49 @@
 }
 add_action( 'bp_notification_settings', 'bp_activity_screen_notification_settings', 1 );
 
+/**
+ * Add blog post comment notifications settings to the notifications settings page.
+ *
+ * @since BuddyPress (1.9.0)
+ *
+ * @uses bp_get_user_meta()
+ * @uses bp_core_get_username()
+ * @uses do_action() To call the 'bp_activity_screen_notification_settings' hook.
+ */
+function bp_activity_blog_post_comment_screen_notification_settings() {
+	global $current_user;
+
+	if ( ! $comment = bp_get_user_meta( bp_displayed_user_id(), 'notification_blog_post_new_comment', true ) ) {
+		$comment = 'yes';
+	}
+
+	?>
+	<table class="notification-settings" id="bp-example-notification-settings">
+
+		<thead>
+		<tr>
+			<th class="icon"></th>
+			<th class="title"><?php _e( 'Blog comments', 'buddypress' ) ?></th>
+			<th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
+			<th class="no"><?php _e( 'No', 'buddypress' )?></th>
+		</tr>
+		</thead>
+
+		<tbody>
+		<tr>
+			<td></td>
+			<td><?php _e( 'A member comments on one of your posts', 'buddypress' ) ?></td>
+			<td class="yes"><input type="radio" name="notifications[notification_blog_post_new_comment]" value="yes" <?php checked( $comment, 'yes', true ) ?>/></td>
+			<td class="no"><input type="radio" name="notifications[notification_blog_post_new_comment]" value="no" <?php checked( $comment, 'no', true ) ?>/></td>
+		</tr>
+
+		<?php do_action( 'bp_activity_blog_post_comment_notification_settings' ); ?>
+
+		</tbody>
+	</table>
+<?php }
+add_action( 'bp_notification_settings', 'bp_activity_blog_post_comment_screen_notification_settings' );
+
 /** Theme Compatability *******************************************************/
 
 /**
