diff --git a/sites/all/modules/contrib/notifications/notifications.cron.inc b/sites/all/modules/contrib/notifications/notifications.cron.inc
index 2461cb4..02d9d6b 100644
--- a/sites/all/modules/contrib/notifications/notifications.cron.inc
+++ b/sites/all/modules/contrib/notifications/notifications.cron.inc
@@ -197,6 +197,12 @@ function notifications_process_rows($conditions, $limit = 0, $update = TRUE) {
   $send_method = $send_interval = $module = NULL;
   $test = notifications_process('option', 'test');
   $count = 0;
+  
+  
+   # PB:2011/01/13 dedubing multiple update notifications
+  $currentCombine = variable_get('notifications_events_dedubing', array());
+  # PB:2011/01/13 dedubing multiple update notifications END
+  
 
   // Build query and fetch rows from queue
   $query = notifications_queue_query($conditions);
@@ -216,8 +222,55 @@ function notifications_process_rows($conditions, $limit = 0, $update = TRUE) {
     notifications_process('count', 'row');
     if (!$account || !$queue || ($queue->module != $module) || ($queue->uid != $account->uid) || ($queue->destination != $destination) || $queue->send_method != $send_method || $queue->send_interval != $send_interval) {
       // New user or sending method or destination, send if not the first row and reset
-      if ($account && $events && $subscriptions) {        
-        $messages = notifications_callback($module, 'process_compose', $account, $events, $subscriptions, $send_method, $send_interval);
+      if ($account && $events && $subscriptions) {
+       
+       # PB:2011/01/13 dedubing multiple update notifications
+       if (isset($currentCombine['combine']) && $currentCombine['combine'] == 1) {
+           $aTmpSuspectNid = array();
+           $aTmpSuspectEvent = array();
+           
+           foreach ($events as $iEventId => $aTmpEvent) {
+               
+               if($aTmpEvent->module == 'node' && ($aTmpEvent->action == 'update' || $aTmpEvent->action == 'insert')) {
+                   
+                   if (isset($aTmpSuspectEvent[$aTmpEvent->oid])) {
+                       
+                       switch ($aTmpEvent->action) {
+                           case 'update':
+                               
+                               if (isset($aTmpSuspectEvent[$aTmpEvent->oid][$aTmpEvent->action])) {
+                                   
+                                   if ($aTmpSuspectEvent[$aTmpEvent->oid][$aTmpEvent->action] > $iEventId) {
+                                       unset($events[$iEventId]);
+                                   } else {
+                                       unset($events[$aTmpSuspectEvent[$aTmpEvent->oid][$aTmpEvent->action]]);
+                                   }
+                                   
+                               } elseif (isset($aTmpSuspectEvent[$aTmpEvent->oid]['insert'])) {
+                                   unset($events[$iEventId]);
+                               }
+                               
+                               break;
+                           case 'insert':
+                               
+                               if (isset($aTmpSuspectEvent[$aTmpEvent->oid]['update'])) {
+                                   unset($events[$aTmpSuspectEvent[$aTmpEvent->oid]['update']]);
+                               }
+                               
+                               break;
+                       }
+                       
+                   } else {
+                       $aTmpSuspectEvent[$aTmpEvent->oid] = array($aTmpEvent->action => $iEventId );
+                   }
+                   
+               }
+               
+           }
+           
+       }
+       # PB:2011/01/13 dedubing multiple update notifications END        
+       $messages = notifications_callback($module, 'process_compose', $account, $events, $subscriptions, $send_method, $send_interval);
         notifications_log('Composed messages', array('number' => count($messages), 'send_method' => $send_method));
         // Note that we pass the testing parameter to notifications_process_send
         notifications_callback($module, 'process_send', $account, $messages, $send_method, $test);