? .cvsignore
? privatemsg_forward
? privatemsg_forward-1.tar.gz
? privatemsg_forward-2.tar_.gz
? privatemsg_forward-3.tar.gz
? privatemsg_forward-4.tar.gz
? privatemsg_realname
? privatemsg_realname.tar.gz
? privatemsg_realname2.patch
? privatemsg_realname2.tar.gz
? privatemsg_realname3.patch
? privatemsg_realname4.patch
? privatemsg_realname5.patch
? privatemsg_realname6.patch
? privatemsg_recipient_list
? privatemsg_recipient_list.tar.gz
? privatemsg_recipient_list_2.patch
? privatemsg_recipient_list_2.tar.gz
? privatemsg_recipient_list_2_small.patch
? privatemsg_validate_fix.patch
? privatemsg_validate_sorting.patch
Index: privatemsg.api.php
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.api.php,v
retrieving revision 1.4
diff -u -p -r1.4 privatemsg.api.php
--- privatemsg.api.php	16 Aug 2010 08:12:25 -0000	1.4
+++ privatemsg.api.php	11 Nov 2010 22:46:58 -0000
@@ -313,7 +313,7 @@ function hook_privatemsg_message_validat
   foreach ($message['recipients'] as $recipient) {
     if ($recipient->name == 'blocked user') {
       $_privatemsg_invalid_recipients[] = $recipient->uid;
-      $errors[] = t('%name has chosen to not recieve any more messages from you.', array('%name' => $recipient->name));
+      $errors[] = t('%name has chosen to not recieve any more messages from you.', array('%name' => privatemsg_recipient_format($recipient, array('plain' => TRUE))));
     }
   }
 }
Index: privatemsg.author-pane.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.author-pane.inc,v
retrieving revision 1.6
diff -u -p -r1.6 privatemsg.author-pane.inc
--- privatemsg.author-pane.inc	10 Aug 2010 19:54:49 -0000	1.6
+++ privatemsg.author-pane.inc	11 Nov 2010 22:46:58 -0000
@@ -12,8 +12,6 @@
 function privatemsg_preprocess_author_pane(&$variables) {
   global $user;
   $account = $variables['account'];
-  $account_id = $account->uid;
-  $account_name = $account->name;
 
   if (function_exists('author_pane_api') && author_pane_api() == "2") {
     // Author Pane 2.x
@@ -25,7 +23,7 @@ function privatemsg_preprocess_author_pa
 
     $url = privatemsg_get_link($account);
     if (!empty($url)) {
-      $variables['privatemsg'] = l(t('Send private message'), $url, array('attributes' => array('class' => 'author-privatemsg-icon', 'title' => t('Send @name a private message', array('@name' => $account_name))), 'html' => TRUE));
+      $variables['privatemsg'] = l(t('Send private message'), $url, array('attributes' => array('class' => 'author-privatemsg-icon', 'title' => t('Send @name a private message', array('@name' => privatemsg_recipient_format($account, array('plain' => TRUE))))), 'html' => TRUE));
 
       // Early versions of the template used this variable so fill it for
       // backwards compatability.
Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.152
diff -u -p -r1.152 privatemsg.module
--- privatemsg.module	10 Nov 2010 15:46:44 -0000	1.152
+++ privatemsg.module	11 Nov 2010 22:47:05 -0000
@@ -1625,7 +1625,7 @@ function _privatemsg_validate_message(&$
       );
     }
     else {
-      $messages['error'][] = t('@user is not allowed to write messages.', array('@user' => $message['author']->name));
+      $messages['error'][] = t('@user is not allowed to write messages.', array('@user' => privatemsg_recipient_format($message['author'], array('plain' => TRUE))));
       return array(
          'success'  => FALSE,
          'messages'   => $messages,
@@ -1663,7 +1663,7 @@ function _privatemsg_validate_message(&$
       form_set_error('format', t('You are not allowed to use the specified format.'));
     }
     else {
-      $messages['error'][] = t('@user is not allowed to use the specified input format.', array('@user' => $message['author']->name));
+      $messages['error'][] = t('@user is not allowed to use the specified input format.', array('@user' => privatemsg_recipient_format($message['author'], array('plain' => TRUE))));
     }
   }
 
Index: privatemsg.pages.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.pages.inc,v
retrieving revision 1.19
diff -u -p -r1.19 privatemsg.pages.inc
--- privatemsg.pages.inc	27 Oct 2010 14:41:00 -0000	1.19
+++ privatemsg.pages.inc	11 Nov 2010 22:47:08 -0000
@@ -178,7 +178,9 @@ function privatemsg_new(&$form_state, $r
   $body      = '';
 
   // convert recipients to array of user objects
+  $unique = FALSE;
   if (!empty($recipients) && is_string($recipients) || is_int($recipients)) {
+    $unique = TRUE;
     $recipients = _privatemsg_generate_user_array($recipients);
   }
   elseif (is_object($recipients)) {
@@ -219,7 +221,7 @@ function privatemsg_new(&$form_state, $r
         continue;
       }
       $to[privatemsg_recipient_key($recipient)] = privatemsg_recipient_format($recipient);
-      $to_plain[privatemsg_recipient_key($recipient)] = privatemsg_recipient_format($recipient, array('plain' => TRUE));
+      $to_plain[privatemsg_recipient_key($recipient)] = privatemsg_recipient_format($recipient, array('plain' => TRUE, 'unique' => $unique));
     }
     else {
       // Recipient list contains blocked users.
Index: pm_block_user/pm_block_user.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/pm_block_user/pm_block_user.module,v
retrieving revision 1.14
diff -u -p -r1.14 pm_block_user.module
--- pm_block_user/pm_block_user.module	27 Oct 2010 14:41:00 -0000	1.14
+++ pm_block_user/pm_block_user.module	11 Nov 2010 22:47:09 -0000
@@ -228,7 +228,7 @@ function pm_block_user_privatemsg_block_
     }
     $blocked[] = array(
       'recipient' => privatemsg_recipient_key($recipient),
-      'message' => t('%name has chosen to block messages from you.', array('%name' => $recipient->name))
+      'message' => t('%name has chosen to block messages from you.', array('%name' => privatemsg_recipient_format($recipient, array('plain' => TRUE))))
     );
   }
   return $blocked;
Index: pm_block_user/pm_block_user.pages.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/pm_block_user/pm_block_user.pages.inc,v
retrieving revision 1.5
diff -u -p -r1.5 pm_block_user.pages.inc
--- pm_block_user/pm_block_user.pages.inc	20 Oct 2010 12:52:58 -0000	1.5
+++ pm_block_user/pm_block_user.pages.inc	11 Nov 2010 22:47:09 -0000
@@ -32,10 +32,10 @@ function pm_block_user_form($form_state,
       '#value' => 'unblock_user',
     );
     return confirm_form($form,
-      t('You have previously blocked "@author" from sending you any more messages. Are you sure you want to unblock this user?', array('@author' => $author->name)),
+      t('You have previously blocked "@author" from sending you any more messages. Are you sure you want to unblock this user?', array('@author' => privatemsg_recipient_format($author, array('plain' => TRUE)))),
       isset($_GET['destination']) ? $_GET['destination'] : privatemsg_get_dynamic_url_prefix(),
       '',
-      t('Unblock @author', array('@author' => $author->name)),
+      t('Unblock @author', array('@author' => privatemsg_recipient_format($author, array('plain' => TRUE)))),
       t('Cancel')
     );
   }
@@ -45,10 +45,10 @@ function pm_block_user_form($form_state,
       '#value' => 'block_user',
     );
     return confirm_form($form,
-      t('Are you sure you want to block "@author" from sending you any more messages?', array('@author' => $author->name)),
+      t('Are you sure you want to block "@author" from sending you any more messages?', array('@author' => privatemsg_recipient_format($author, array('plain' => TRUE)))),
       isset($_GET['destination']) ? $_GET['destination'] : privatemsg_get_dynamic_url_prefix(),
       '',
-      t('Block @author', array('@author' => $author->name)),
+      t('Block @author', array('@author' => privatemsg_recipient_format($author, array('plain' => TRUE)))),
       t('Cancel')
     );
   }
Index: pm_email_notify/pm_email_notify.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/pm_email_notify/pm_email_notify.module,v
retrieving revision 1.15
diff -u -p -r1.15 pm_email_notify.module
--- pm_email_notify/pm_email_notify.module	22 Oct 2010 09:02:10 -0000	1.15
+++ pm_email_notify/pm_email_notify.module	11 Nov 2010 22:47:10 -0000
@@ -87,7 +87,7 @@ function pm_email_notify_mail($key, &$me
  */
 function _pm_email_notify_token($recipient, $message, $language) {
   $tokens = array(
-    '!author' => $message['author']->name,
+    '!author' => privatemsg_recipient_format($message['author'], array('plain' => TRUE)),
     '!pm_subject' => trim(drupal_html_to_text(check_plain($message['subject']))),
     '!pm_body' => trim(drupal_html_to_text(check_markup($message['body'], $message['format'], FALSE))),
     '!thread' => $message['thread_id'],
Index: privatemsg_filter/privatemsg_filter.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg_filter/privatemsg_filter.module,v
retrieving revision 1.15
diff -u -p -r1.15 privatemsg_filter.module
--- privatemsg_filter/privatemsg_filter.module	22 Oct 2010 08:48:35 -0000	1.15
+++ privatemsg_filter/privatemsg_filter.module	11 Nov 2010 22:47:13 -0000
@@ -403,7 +403,7 @@ function privatemsg_filter_dropdown_set_
   if (isset($filter['author'])) {
     $string = '';
     foreach ($filter['author'] as $author) {
-      $string .= $author->name . ', ';
+      $string .= privatemsg_recipient_format($author, array('plain' => TRUE)) . ', ';
     }
     $form['filter']['author']['#default_value'] = $string;
   }
@@ -484,10 +484,10 @@ function privatemsg_filter_create_get_qu
   if (isset($filter['author']) && !empty($filter['author'])) {
     foreach ($filter['author'] as $author) {
       if (is_object($author) && isset($author->uid) && isset($author->name)) {
-        $query['author'][] = $author->name;
+        $query['author'][] = privatemsg_recipient_format($author, array('plain' => TRUE));
       }
       elseif (is_int($author) && $author_obj = _privatemsg_user_load($author)) {
-        $query['author'][] = $author_obj->name;
+        $query['author'][] = privatemsg_recipient_format($author, array('plain' => TRUE));
       }
     }
     if (isset($query['author'])) {
Index: tests/privatemsgapi.test
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/tests/privatemsgapi.test,v
retrieving revision 1.7
diff -u -p -r1.7 privatemsgapi.test
--- tests/privatemsgapi.test	17 Aug 2010 13:05:41 -0000	1.7
+++ tests/privatemsgapi.test	11 Nov 2010 22:47:13 -0000
@@ -60,6 +60,8 @@ class PrivatemsgAPITestCase extends Drup
 
     $resultf3 = privatemsg_new_thread(array($recipient1, $recipient2, $recipient3), 'not allowed', 'Body text', array('author' => $recipient1));
     $errormessage = t('@user is not allowed to write messages.', array('@user' => $recipient1->name));
+    $this->fail($resultf3['messages']['error'][0]);
+    $this->fail($errormessage);
     $this->assertEqual($errormessage, $resultf3['messages']['error'][0], 'API denied to send message from user without permission');
     $message = $this->getMessageFromSubject('not allowed');
     $this->assertTrue(empty($message), 'Message was not saved in database');
