summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Terenchuk2009-02-22 21:21:08 (GMT)
committer Oleg Terenchuk2009-02-22 21:21:08 (GMT)
commit3f51bb2bea6315a5affe01bdd286d744eb828d9e (patch)
treef414746ba35ab882c5c28de972625b80644e4f92
parentbb64352e282d79c437856ab0506c3e7355bf00e0 (diff)
#376034 by Berdir: #288183 followup: user blocking doesnt work when sending to group of users that contains at least one non blocked user
-rw-r--r--privatemsg.module11
1 files changed, 7 insertions, 4 deletions
diff --git a/privatemsg.module b/privatemsg.module
index 2e050f6..90fea1b 100644
--- a/privatemsg.module
+++ b/privatemsg.module
@@ -723,12 +723,15 @@ function pm_send_validate($form, &$form_state) {
if (!empty($invalid)) {
drupal_set_message(t('The following users will not receive this private message: @invalid', array('@invalid' => implode(", ", $invalid))), 'error');
}
- $form_state['values']['recipient'] = implode(', ', array_diff($valid, $invalid));
}
function pm_send($form, &$form_state) {
- if (_privatemsg_send($form_state['validate_built_message'])) {
- drupal_set_message(t('A message has been sent to @recipients.', array('@recipients' => $form_state['values']['recipient'])));
+ if (_privatemsg_send($form_state['validate_built_message'])) { // Load usernames to which the message was sent to
+ $recipient_names = array();
+ foreach ($form_state['validate_built_message']['recipients'] as $recipient) {
+ $recipient_names[] = theme('username', $recipient);
+ }
+ drupal_set_message(t('A message has been sent to !recipients.', array('!recipients' => implode(', ', $recipient_names))));
}
}
@@ -1211,7 +1214,7 @@ function privatemsg_reply($thread_id, $body, $author = NULL) {
}
}
-function _privatemsg_validate_message($message, $author, $show_warnings = FALSE) {
+function _privatemsg_validate_message(&$message, $author, $show_warnings = FALSE) {
$errors = array();
if (!privatemsg_user_access('write privatemsg', $author)) {