Index: bp-activity-functions.php
===================================================================
--- bp-activity-functions.php	(revision 11288)
+++ bp-activity-functions.php	(working copy)
@@ -3768,13 +3768,18 @@
 function bp_activity_do_heartbeat() {
 	$retval = false;
 
-	if ( ! bp_is_activity_heartbeat_active() ) {
-		return $retval;
+	if ( bp_is_activity_heartbeat_active() ) {
+		if ( bp_is_activity_directory() || bp_is_group_activity() ) {
+			$retval = true;
+		}
 	}
 
-	if ( bp_is_activity_directory() || bp_is_group_activity() ) {
-		$retval = true;
-	}
-
-	return $retval;
+	/**
+	 * Filters whether the heartbeat function in the activity stream should be active.
+	 *
+	 * @since 2.8
+	 *
+	 * @param bool $retval Whether or not the heartbeat function should be active.
+	 */
+	return apply_filters( 'bp_activity_do_heartbeat', $retval );
 }
