Index: privatemsg_views.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg_views/Attic/privatemsg_views.module,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 privatemsg_views.module
--- privatemsg_views.module	7 Sep 2010 14:08:39 -0000	1.1.2.7
+++ privatemsg_views.module	28 Dec 2010 01:52:35 -0000
@@ -54,11 +54,11 @@ function privatemsg_views_get_participan
     }
   }
   if (!empty($select_threads)) {
-    $query  = "SELECT pmi.uid, pmi.thread_id, u.name, m.timestamp IS NULL AS not_author FROM {pm_index} pmi";
+    $query  = "SELECT pmi.uid, pmi.thread_id, u.name, MIN(m.timestamp IS NULL) AS not_author FROM {pm_index} pmi";
     $query .= " INNER JOIN {users} u ON pmi.uid = u.uid";
     $query .= " LEFT JOIN {pm_message} m ON pmi.mid = m.mid AND pmi.uid = m.author";
     $query .= " WHERE pmi.thread_id IN (". db_placeholders($select_threads) .")";
-    $query .= " ORDER BY not_author ASC, m.timestamp ASC";
+    $query .= " GROUP BY uid ORDER BY not_author ASC, m.timestamp ASC";
 
     $query_result = db_query($query, $select_threads);
     // Array to maintain user uniqueness per-thread. 
@@ -70,13 +70,10 @@ function privatemsg_views_get_participan
       if (!is_array($thread_users[$item->thread_id])) {
         $thread_users[$item->thread_id] = array();
       }
-      // Do we have this user already ?
-      if (!in_array($item->uid, $thread_users[$item->thread_id])) {
-        // Adding users in the same order we get them from DB
-        $result[$item->thread_id][] = $cache[$item->thread_id][] = $item;
-        // Add uid to the list of unique thread participants.
-        $thread_users[$item->thread_id][] = $item->uid;
-      }
+      // Adding users in the same order we get them from DB
+      $result[$item->thread_id][] = $cache[$item->thread_id][] = $item;
+      // Add uid to the list of unique thread participants.
+      $thread_users[$item->thread_id][] = $item->uid;
     }
   }
   return $result;
