Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.70.2.30.2.91.2.43
diff -u -p -r1.70.2.30.2.91.2.43 privatemsg.module
--- privatemsg.module	23 Apr 2009 00:18:36 -0000	1.70.2.30.2.91.2.43
+++ privatemsg.module	25 Apr 2009 10:40:25 -0000
@@ -249,6 +249,8 @@ function privatemsg_view_access() {
  * @ingroup api
  */
 function privatemsg_thread_load($thread_id, $account = NULL) {
+  static $threads = array();
+
   if ((int)$thread_id > 0) {
     $thread = array();
 
@@ -256,6 +258,11 @@ function privatemsg_thread_load($thread_
       global $user;
       $account = drupal_clone($user);
     }
+
+    if (isset($threads[$account->uid][$thread_id])) {
+      return $threads[$account->uid][$thread_id];
+    }
+
     // load messages returned by the messages query with _privatemsg_load().
     $query = _privatemsg_assemble_query('messages', array($thread_id), $account);
     $conversation = db_query($query['query']);
@@ -280,7 +287,7 @@ function privatemsg_thread_load($thread_
     while ($result = db_fetch_array($participants)) {
       $thread['participants'][$result['uid']] = user_load($result['uid']);
     }
-    return $thread;
+    return $threads[$account->uid][$thread_id] = $thread;
   }
   return FALSE;
 }
