Index: privatemsg.pages.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.pages.inc,v
retrieving revision 1.14
diff -u -p -r1.14 privatemsg.pages.inc
--- privatemsg.pages.inc	16 Aug 2010 08:12:25 -0000	1.14
+++ privatemsg.pages.inc	7 Sep 2010 07:46:02 -0000
@@ -197,7 +197,7 @@ function privatemsg_new(&$form_state, $r
   $usercount = 0;
   $to = array();
   $to_plain = array();
-  $blocked = FALSE;
+  $blocked_messages = array();
   foreach ($recipients as $recipient) {
     if ($recipient->type == 'hidden') {
       continue;
@@ -223,12 +223,14 @@ function privatemsg_new(&$form_state, $r
       $to_plain[privatemsg_recipient_key($recipient)] = privatemsg_recipient_format($recipient, array('plain' => TRUE));
     }
     else {
-      // Recipient list contains blocked users.
-      $blocked = TRUE;
+      // Store blocked messages. These are only displayed if all recipients
+      // are blocked.
+      $first_reason = reset($user_blocked);
+      $blocked_messages[] = $first_reason['message'];
     }
   }
 
-  if (empty($to) && $usercount >= 1 && !$blocked) {
+  if (empty($to) && $usercount >= 1 && empty($blocked_messages)) {
     // Assume the user sent message to own account as if the usercount is one or less, then the user sent a message but not to self.
     $to['user_' . $user->uid] = privatemsg_recipient_format($user);
     $to_plain['user_' . $user->uid] = privatemsg_recipient_format($user, array('plain' => TRUE));
@@ -352,13 +354,24 @@ function privatemsg_new(&$form_state, $r
       '#default_value' => $subject,
     );
     $recipients_string_themed = implode(', ', $to);
-    $form['privatemsg']['recipient_display'] = array(
-      '#value' =>  '<p>'. t('<strong>Reply to thread</strong>:<br /> Recipients: !to', array('!to' => $recipients_string_themed)) .'</p>',
-      '#weight' => -10,
-    );
+    if (!empty($recipients_string_themed)) {
+      $form['privatemsg']['recipient_display'] = array(
+        '#value' =>  '<p>'. t('<strong>Reply to thread</strong>:<br /> Recipients: !to', array('!to' => $recipients_string_themed)) .'</p>',
+        '#weight' => -10,
+      );
+    }
     if (empty($recipients_string)) {
-      // If there are no valid recipients, unset the message reply form.
-      $form['privatemsg']['#access'] = FALSE;
+      // If there are no valid recipients, hide all visible parts of the form.
+      foreach (element_children($form['privatemsg']) as $element) {
+        $form['privatemsg'][$element]['#access'] = FALSE;
+      }
+
+      // Display a message if some users are blocked.
+      if (!empty($blocked_messages)) {
+        $blocked = t('You can not reply to this conversation because all recipients are blocked.');
+        $blocked .= theme('item_list', $blocked_messages);
+        $form['privatemsg']['blocked']['#value'] = $blocked;
+      }
     }
   }
   // Only set read all if it is a boolean TRUE. It might also be an integer set
