Index: privatemsg-view.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg/privatemsg-view.tpl.php,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 privatemsg-view.tpl.php
--- privatemsg-view.tpl.php	19 Feb 2009 20:02:36 -0000	1.1.2.4
+++ privatemsg-view.tpl.php	10 Jul 2009 13:45:13 -0000
@@ -3,6 +3,7 @@
   //each file loads it's own styles because we cant predict which file will be loaded
   drupal_add_css(drupal_get_path('module', 'privatemsg').'/styles/privatemsg-view.css');
 ?>
+<?php print $anchors; ?>
 <div class="privatemsg-box-fb" id="privatemsg-mid-<?php print $mid; ?>">
   <div class="left-column">
     <div class="avatar-fb">
Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.70.2.30.2.91.2.57
diff -u -r1.70.2.30.2.91.2.57 privatemsg.module
--- privatemsg.module	7 Jul 2009 23:31:43 -0000	1.70.2.30.2.91.2.57
+++ privatemsg.module	10 Jul 2009 13:46:40 -0000
@@ -355,7 +355,7 @@
     '#options' => array(
       'participants'    => t('Participants'),
       'thread_started'  => t('Started'),
-      'count'           => t('Answers'),
+      'count'           => t('Messages'),
     ),
     '#default_value' => variable_get('privatemsg_display_fields', array('participants')),
   );
@@ -426,13 +426,22 @@
   $vars['message_timestamp'] = format_date($message['timestamp'], 'small');
   $vars['message_body'] = check_markup($message['body']);
   if (isset($vars['mid'])) {
-    $vars['message_actions'][] = array('title' => t('Delete message'), 'href' => 'messages/delete/'. $vars['mid']);
+    $vars['message_actions'][] = array('title' => t('Delete message'), 'href' => 'messages/delete/' . $vars['mid']);
+  }
+  $vars['message_anchors'][] = 'privatemsg-mid-' . $vars['mid'];
+  if (!empty($message['is_new'])) {
+    $vars['message_anchors'][] = 'new';
   }
 
   // call hook_privatemsg_message_view_alter
   drupal_alter('privatemsg_message_view', $vars);
 
   $vars['message_actions'] = !empty($vars['message_actions']) ? theme('links', $vars['message_actions'], array('class' => 'message-actions')) : '';
+  
+  $vars['anchors'] = '';
+  foreach ($vars['message_anchors'] as $anchor) {
+    $vars['anchors'].= '<a name="' . $anchor . '"></a>';
+  }
 }
 
 function privatemsg_preprocess_privatemsg_to(&$vars) {
@@ -845,7 +854,7 @@
   $fragments['select'][]      = 'pmi.thread_id';
   $fragments['select'][]      = 'MIN(pm.subject) as subject';
   $fragments['select'][]      = 'MAX(pm.timestamp) as last_updated';
-  $fragments['select'][]      = 'MAX(pmi.is_new) as is_new';
+  $fragments['select'][]      = 'SUM(pmi.is_new) as is_new';
 
   if (in_array('count', $fields)) {
     $fragments['select'][]      = 'COUNT(distinct pmi.mid) as count'; // We only want the distinct number of messages in this thread.
Index: privatemsg.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg/Attic/privatemsg.theme.inc,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 privatemsg.theme.inc
--- privatemsg.theme.inc	8 Jun 2009 11:19:18 -0000	1.1.2.5
+++ privatemsg.theme.inc	10 Jul 2009 13:49:45 -0000
@@ -94,7 +94,13 @@
  */
 function phptemplate_privatemsg_list_field__subject($thread) {
   $field = array();
-  $field['data'] =l($thread['subject'], 'messages/view/'. $thread['thread_id']);
+  $options = array();
+  $is_new = '';
+  if (!empty($thread['is_new'])) {
+    $is_new = theme_mark(MARK_NEW);
+    $options['fragment'] = 'new';
+  }
+  $field['data'] = l($thread['subject'], 'messages/view/' . $thread['thread_id'], $options) . $is_new;
   $field['class'] = 'privatemsg-list-subject';
   return $field;
 }
@@ -106,7 +112,12 @@
  */
 function phptemplate_privatemsg_list_field__count($thread) {
   $field = array();
-  $field['data'] =$thread['count'] -1;
+  $field['data'] = $thread['count'];
+  $options = array();
+  if (!empty($thread['is_new']) && $thread['is_new'] < $thread['count']) {
+    $options['fragment'] = 'new';
+    $field['data'] .= '<br />' . l((format_plural($thread['is_new'], '(1 new)', '(@count new)')),'messages/view/' . $thread['thread_id'], $options);
+  }
   $field['class'] = 'privatemsg-list-count';
   return $field;
 }
@@ -172,7 +183,7 @@
  */
 function phptemplate_privatemsg_list_header__count() {
   return array(
-    'data'    => t('Answers'),
+    'data'    => t('Messages'),
     'key'     => 'count',
     'class'   => 'privatemsg-header-count',
     '#weight' => -25,
Index: styles/privatemsg-list.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg/styles/privatemsg-list.css,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 privatemsg-list.css
--- styles/privatemsg-list.css	10 Apr 2009 15:25:49 -0000	1.1.2.1
+++ styles/privatemsg-list.css	10 Jul 2009 13:45:13 -0000
@@ -1,3 +1,11 @@
 .privatemsg-unread .privatemsg-list-subject {
   font-weight: bold;
-}
\ No newline at end of file
+}
+
+.privatemsg-unread .privatemsg-list-subject .marker {
+  font-weight: lighter;
+}
+
+.privatemsg-list-count {
+  text-align: center;
+}

