Index: activity.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/activity/activity.module,v
retrieving revision 1.1.2.2.2.26
diff -b -u -p -r1.1.2.2.2.26 activity.module
--- activity.module	15 Apr 2008 16:30:00 -0000	1.1.2.2.2.26
+++ activity.module	17 Apr 2008 14:57:25 -0000
@@ -246,7 +246,7 @@ function activity_get_activity($uids = A
 
   // Build sql limiting query to on filtered fields
   if (!empty($filters) && is_array($filters)) {
-    foreach ($filters as $column => $values) {
+    foreach ($filters as $column => $filter) {
       // Of the possible columns, role is in the at table and all others in the
       // a table. Prefix the column name with the appropriate table.
       if ($column == 'target_role') {
@@ -255,20 +255,22 @@ function activity_get_activity($uids = A
       else {
         $column = "activity.{$column}";
       }
+      foreach ($filter as $criteria => $values) {
       if (is_array($values) && count($values) > 1) {
         foreach ($values as $value) {
           $strings[] = "'%s'";
           $params[] = $value;
         }
-        $wheres[] = $column. ' IN ('. implode(',', $strings). ')';
+          $wheres[] = $column . ($criteria == 'exclude' ? ' NOT IN ' : ' IN ') .'('. implode(',', $strings). ')';
       }
       else {
-        $wheres[] = $column. " = '%s'";
+          $wheres[] = $column . ($criteria == 'exclude' ? ' != ' : ' = ') ."'%s'";
         // $values is a string with the single value.
         $params[] = $values;
       }
     }
   }
+  }
   if (count($wheres) > 0) {
     $where = implode(' AND ', $wheres);
     $where = "WHERE $where";
