Index: heartbeat-message-row.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/heartbeat/Attic/heartbeat-message-row.tpl.php,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 heartbeat-message-row.tpl.php
--- heartbeat-message-row.tpl.php	9 Jun 2010 20:05:23 -0000	1.1.2.11
+++ heartbeat-message-row.tpl.php	15 Jan 2011 23:37:27 -0000
@@ -45,4 +45,16 @@
 
   </div>
 
+  <?php if (count($message->uaids) > 0) :?>
+  <div class="beat-item <?php print $message->classes ?>" id="beat-item-<?php print $message->uaid ?>-ungrouped" style="display: none;">
+  <?php foreach ($message->additions->source as $ungrouped_message) { ?>
+  <?php print $ungrouped_message; ?><br />
+  <?php } ?>
+    <div class="heartbeat-buttons">
+    <?php print l(t('Back'), drupal_get_destination(), array('attributes' => array('onclick' => 'javascript:Drupal.heartbeat.splitGroupedMessage(' . $message->uaid .', null); return false;')))?>
+    </div>
+    <br class="clearfix" />
+  </div>
+  <?php endif; ?>
+
 </div>
\ No newline at end of file
Index: heartbeat.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/heartbeat/Attic/heartbeat.js,v
retrieving revision 1.1.2.1.2.22
diff -u -r1.1.2.1.2.22 heartbeat.js
--- heartbeat.js	13 Dec 2010 21:51:36 -0000	1.1.2.1.2.22
+++ heartbeat.js	15 Jan 2011 23:37:28 -0000
@@ -121,6 +121,27 @@
 }
 
 /**
+ * splitGroupedMessage().
+ * 
+ * Splits a grouped message into separate ones.
+ * 
+ * @param Integer uaid
+ *   The user activity Id for the grouped message.
+ * @param Array uaids
+ *   The standalone user activity Ids involved in the grouped message.
+ */
+Drupal.heartbeat.splitGroupedMessage = function(uaid, uaids) {
+  if (uaids == null) {
+    $("#beat-item-" + uaid).show('slow');
+    $("#beat-item-" + uaid + "-ungrouped").hide('slow');  
+  }
+  else {
+    $("#beat-item-" + uaid).hide('slow');
+    $("#beat-item-" + uaid + "-ungrouped").show('slow'); 
+  }
+}
+
+/**
  * Document onReady().
  */
 $(document).ready(function() {
Index: heartbeat.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/heartbeat/heartbeat.module,v
retrieving revision 1.1.2.26.2.46.2.105
diff -u -r1.1.2.26.2.46.2.105 heartbeat.module
--- heartbeat.module	5 Jan 2011 18:33:49 -0000	1.1.2.26.2.46.2.105
+++ heartbeat.module	15 Jan 2011 23:37:28 -0000
@@ -566,7 +566,7 @@
       '@node_title' => '[node:title-link]',
     ),
   );
-    
+
   $info['heartbeat_add_node'] = array(
     'message' => '!username has added !node_type !node_title.',
     'message_concat' => '!username has added the following !types: %node_title%.',
@@ -672,7 +672,7 @@
       ),
     );
   }
-  
+
   return $info;
 }
 
@@ -862,7 +862,7 @@
   global $user;
   $buttons = array();
   if ($message->delete_access || ($message->actor_access && $message->uid == $user->uid)) {
-    $buttons[] = '<span class="hover-delete">' . l(t('Delete'), 'heartbeat/delete/' . $message->uaid, array('query' => drupal_get_destination(), 'alias' => TRUE)) . '</span>';
+    $buttons[] = $message->delete_button();
   }
 
   return implode('', $buttons);
Index: includes/heartbeatactivity.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/heartbeat/includes/Attic/heartbeatactivity.inc,v
retrieving revision 1.1.2.1.2.43
diff -u -r1.1.2.1.2.43 heartbeatactivity.inc
--- includes/heartbeatactivity.inc	5 Jan 2011 12:49:46 -0000	1.1.2.1.2.43
+++ includes/heartbeatactivity.inc	15 Jan 2011 23:37:28 -0000
@@ -164,6 +164,20 @@
     return t($this->template->message, $variables);
   }
 
+  /**
+   * Create the link for a delete button.
+   */
+  public function delete_button($args = array()) {
+    $attributes = array('query' => drupal_get_destination(), 'alias' => TRUE);
+    if (count($this->uaids) > 1) {
+      $attributes['attributes'] = array(
+        'onclick' => 'javascript:Drupal.heartbeat.splitGroupedMessage('. $this->uaid .', new Array('. implode(",", $this->uaids) .')); return false;',
+      );
+    }
+    $attributes += $args;
+    return '<span class="hover-delete">' . l(t('Delete'), 'heartbeat/delete/' . $this->uaid, $attributes) . '</span>';
+  }
+
   /*
    * Rebuild the message with given candidate variables
    */
Index: includes/heartbeatparser.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/heartbeat/includes/Attic/heartbeatparser.inc,v
retrieving revision 1.1.2.3.2.32
diff -u -r1.1.2.3.2.32 heartbeatparser.inc
--- includes/heartbeatparser.inc	20 Nov 2010 10:17:28 -0000	1.1.2.3.2.32
+++ includes/heartbeatparser.inc	15 Jan 2011 23:37:28 -0000
@@ -142,10 +142,12 @@
           );
           // Add the message
           $this->_messages[$gap_id] = $message;
+          $this->_messages[$gap_id]->additions->source = array($message->message . $message->delete_button());
         }
         // Make sure the the timestamp gets updated
         else {
           $this->_messages[$gap_id]->timestamp = $message->timestamp;
+          $this->_messages[$gap_id]->additions->source[] = $message->message . $message->delete_button();
         }
 
         // Add the counters and variables needed for merging in groups
@@ -153,6 +155,7 @@
 
         $this->_candidates[$gap_id]['variables'][] = $message->variables;
         $this->_candidates[$gap_id]['count']++;  // variable count, NOT the same as target_count
+        $this->_messages[$gap_id]->uaids[] = $message->uaid;
       }
       elseif ($type == 'count') {
 
@@ -312,7 +315,6 @@
       if ($candidate['count'] > 1) {
         // rebuild the message using the candidate variables
         $this->_messages[$single_id]->create_grouped_message($candidate, $max_items_to_group);
-
       }
     }
   }
