Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.70.2.30.2.91.2.63
diff -u -p -r1.70.2.30.2.91.2.63 privatemsg.module
--- privatemsg.module	22 Jul 2009 15:02:52 -0000	1.70.2.30.2.91.2.63
+++ privatemsg.module	24 Jul 2009 13:09:52 -0000
@@ -315,39 +315,36 @@ function privatemsg_privatemsg_view_temp
 
 function private_message_settings() {
   $form = array();
-
-  $form['theming_settings'] = array(
+  $form['display'] = array(
     '#type'        => 'fieldset',
     '#collapsible' => TRUE,
-    '#collapsed'   => TRUE,
-    '#title'       => t('Theming settings'),
+    '#collapsed'   => FALSE,
+    '#title'       => t('Display settings'),
   );
-  $form['theming_settings']['private_message_view_template'] = array(
+  $form['display']['private_message_view_template'] = array(
     '#type'          => 'radios',
     '#title'         => t('Private message display template'),
     '#default_value' => variable_get('private_message_view_template', 'privatemsg-view'),
     '#options'       => private_message_view_options(),
   );
-  $form['privatemsg_per_page'] = array(
-    '#type' => 'select',
-    '#title' => t('Messages per page'),
-    '#default_value' => variable_get('privatemsg_per_page', 25),
-    '#options' => drupal_map_assoc(array(10, 25, 50, 75, 100)),
-    '#description' => t('Choose the number of conversations that should be listed per page.'),
-  );
-  $form['privatemsg_display_loginmessage'] = array(
+  $form['display']['privatemsg_display_loginmessage'] = array(
     '#type' => 'checkbox',
     '#title' => t('Inform the user about new messages on login'),
     '#default_value' => variable_get('privatemsg_display_loginmessage', TRUE),
     '#description' => t('This option can safely be disabled if the "New message indication" block is used instead.'),
   );
+  $form['display']['privatemsg_display_link_self'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Display "Send this user a message" links for themself'),
+    '#description' => t('If enabled, each users sees that link on their own profile, comments and similiar places.'),
+    '#default_value' => variable_get('privatemsg_display_link_self', TRUE),
+  );
   $form['privatemsg_listing'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Configure listings'),
+    '#title' => t('List settings'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
-
   $form['privatemsg_listing']['privatemsg_display_fields'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Configure fields'),
@@ -359,7 +356,13 @@ function private_message_settings() {
     ),
     '#default_value' => variable_get('privatemsg_display_fields', array('participants')),
   );
-
+  $form['privatemsg_listing']['privatemsg_per_page'] = array(
+    '#type' => 'select',
+    '#title' => t('Messages per page'),
+    '#default_value' => variable_get('privatemsg_per_page', 25),
+    '#options' => drupal_map_assoc(array(10, 25, 50, 75, 100)),
+    '#description' => t('Choose the number of conversations that should be listed per page.'),
+  );
   $form['#submit'][] = 'private_message_settings_submit';
   return system_settings_form($form);
 }
@@ -1473,6 +1476,9 @@ function privatemsg_get_link($recipients
     if (!privatemsg_user_access('read privatemsg', $recipient)) {
       continue;
     }
+    if (variable_get('privatemsg_display_link_self', TRUE) == FALSE && $account->uid == $recipient->uid) {
+      continue;
+    }
     if (count(module_invoke_all('privatemsg_block_message', $account, array($recipient))) > 0) {
       continue;
     }
Index: privatemsg.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.install,v
retrieving revision 1.5.2.4.2.11.2.11
diff -u -p -r1.5.2.4.2.11.2.11 privatemsg.install
--- privatemsg.install	7 Jul 2009 23:31:43 -0000	1.5.2.4.2.11.2.11
+++ privatemsg.install	24 Jul 2009 13:09:52 -0000
@@ -109,6 +109,7 @@ function privatemsg_uninstall() {
   variable_del('privatemsg_per_page');
   variable_del('privatemsg_display_loginmessage');
   variable_del('privatemsg_display_fields');
+  variable_del('privatemsg_display_link_self');
   drupal_uninstall_schema('privatemsg');
 }
 
