Index: activity.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/activity/activity.module,v
retrieving revision 1.1.2.2.2.30.2.46
diff -u -p -r1.1.2.2.2.30.2.46 activity.module
--- activity.module	3 Jun 2009 18:42:21 -0000	1.1.2.2.2.30.2.46
+++ activity.module	17 Feb 2010 00:39:03 -0000
@@ -487,7 +487,10 @@ function activity_get_info() {
  *   nodeactivity module tracks activities for each content type separately.
  *   This should be an identifier for the calling module to use.
  */
-function activity_insert($uid, $module, $type, $operation, $data, $target_users_roles) {
+function activity_insert($uid, $module, $type, $operation, $data, $target_users_roles, $time = NULL ) {
+  if( is_null($time) ){
+    $time = time();
+  }
   // check time limit, ignore activity if within the limit
   $result = db_query("SELECT COUNT(*) FROM {activity} WHERE uid = %d AND module = '%s' AND type = '%s' AND operation = '%s' AND data = '%s' AND created >= %d", $uid, $module, $type, $operation, serialize($data), (time() - variable_get('activity_time_limit', 30)));
   
@@ -497,7 +500,7 @@ function activity_insert($uid, $module, 
 
   db_query("INSERT INTO {activity} (uid, module,  type,  operation,  created, data)
                             VALUES (%d,  '%s',    '%s',  '%s',       %d,      '%s')",
-                                   $uid, $module, $type, $operation, time(),  serialize($data));
+                                   $uid, $module, $type, $operation, $time,  serialize($data));
   $aid = db_last_insert_id('activity', 'aid');
   foreach ($target_users_roles as $target_uid => $role) {
     db_query("INSERT INTO {activity_targets} (aid, target_uid, target_role) VALUES (%d, %d, '%s')", $aid, $target_uid, $role);
@@ -525,7 +528,7 @@ function activity_insert($uid, $module, 
  * @param $aid
  *   Activity id.
  */
-function activity_delete($aid = NULL) {
+function activity_delete($aid = NULL, $redirect = TRUE) {
   if ($aid && is_numeric($aid)) {
     if (module_exists('activityhistory')) {
       db_query('DELETE FROM {activity_history} WHERE aid = %d', $aid);
@@ -534,7 +537,9 @@ function activity_delete($aid = NULL) {
     db_query('DELETE FROM {activity} WHERE aid = %d', $aid);
     db_query('DELETE FROM {activity_comments} WHERE aid = %d', $aid);
   }
-  drupal_goto(drupal_get_destination());
+  if( $redirect ){
+    drupal_goto(drupal_get_destination());
+  }
 }
 
 /**
