Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.24
diff -u -p -r1.24 contact.pages.inc
--- modules/contact/contact.pages.inc	18 Sep 2009 00:12:46 -0000	1.24
+++ modules/contact/contact.pages.inc	25 Sep 2009 21:56:26 -0000
@@ -50,6 +50,8 @@ function contact_site_form() {
   }
 
   $form['#token'] = $user->uid ? $user->name . $user->mail : '';
+  $form['message'] = array('#type' => 'value', '#value' => t('Your message has been sent.'));
+  $form['redirect'] = array('#type' => 'value', '#value' => '');
   $form['name'] = array(
     '#type' => 'textfield',
     '#title' => t('Your name'),
@@ -141,11 +143,11 @@ function contact_site_form_submit($form,
 
   flood_register_event('contact');
   watchdog('mail', '%name-from sent an e-mail regarding %category.', array('%name-from' => $values['name'] . " [$from]", '%category' => $contact['category']));
-  drupal_set_message(t('Your message has been sent.'));
+  drupal_set_message($values['message']);
 
   // Jump to home page rather than back to contact page to avoid
   // contradictory messages if flood control has been activated.
-  $form_state['redirect'] = '';
+  $form_state['redirect'] = $values['redirect'];
 }
 
 /**
@@ -175,6 +177,8 @@ function contact_personal_form($form, &$
   global $user;
   $form['#token'] = $user->name . $user->mail;
   $form['recipient'] = array('#type' => 'value', '#value' => $recipient);
+  $form['message'] = array('#type' => 'value', '#value' => t('Your message has been sent.'));
+  $form['redirect'] = array('#type' => 'value', '#value' => "user/$recipient->uid");
   $form['from'] = array('#type' => 'item',
     '#title' => t('From'),
     '#markup' => theme('username', $user) . ' &lt;' . check_plain($user->mail) . '&gt;',
@@ -229,8 +233,8 @@ function contact_personal_form_submit($f
 
   flood_register_event('contact');
   watchdog('mail', '%name-from sent %name-to an e-mail.', array('%name-from' => $user->name, '%name-to' => $account->name));
-  drupal_set_message(t('Your message has been sent.'));
+  drupal_set_message($values['message']);
 
   // Back to the requested users profile page.
-  $form_state['redirect'] = "user/$account->uid";
+  $form_state['redirect'] = $values['redirect'];
 }
