? .cvsignore
? privatemsg_mollom.patch
Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.119
diff -u -p -r1.119 privatemsg.module
--- privatemsg.module	20 Feb 2010 08:56:58 -0000	1.119
+++ privatemsg.module	23 Feb 2010 16:19:39 -0000
@@ -1924,4 +1924,22 @@ function privatemsg_views_api() {
     'api' => 2,
     'path' => drupal_get_path('module', 'privatemsg') . '/views',
   );
+}
+
+/**
+ * Implements hook_mollom_form_info().
+ */
+function privatemsg_mollom_form_info() {
+  return array(
+    'privatemsg_new' => array(
+      'title' => t('Send new message form'),
+      'bypass access' => array('administer privatemsg'),
+      'entity' => 'privatemsg_message',
+      'elements' => array(
+        'subject' => t('Subject'),
+        'body' => t('Body'),
+      ),
+      'mapping' => array('post_id' => 'mid'),
+    ),
+  );
 }
\ No newline at end of file
Index: privatemsg.pages.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.pages.inc,v
retrieving revision 1.1
diff -u -p -r1.1 privatemsg.pages.inc
--- privatemsg.pages.inc	2 Dec 2009 20:03:59 -0000	1.1
+++ privatemsg.pages.inc	23 Feb 2010 16:19:39 -0000
@@ -250,16 +250,16 @@ function privatemsg_new(&$form_state, $r
       '#value'  => $form_state['privatemsg_preview'],
     );
   }
-  $form['privatemsg'] = array(
+  $form = array(
     '#type'               => 'fieldset',
     '#access'             => privatemsg_user_access('write privatemsg'),
   );
-  $form['privatemsg']['author'] = array(
+  $form['author'] = array(
     '#type' => 'value',
     '#value' => $user,
   );
   if (is_null($thread_id)) {
-    $form['privatemsg']['recipient'] = array(
+    $form['recipient'] = array(
       '#type'               => 'textfield',
       '#title'              => t('To'),
       '#description'        => t('Separate multiple names with commas.'),
@@ -271,7 +271,7 @@ function privatemsg_new(&$form_state, $r
       // Do not hardcode #maxlength, make it configurable by number of recipients, not their name length.
     );
   }
-  $form['privatemsg']['subject'] = array(
+  $form['subject'] = array(
     '#type'               => 'textfield',
     '#title'              => t('Subject'),
     '#size'               => 50,
@@ -279,7 +279,7 @@ function privatemsg_new(&$form_state, $r
     '#default_value'      => $subject,
     '#weight'             => -5,
   );
-  $form['privatemsg']['body'] = array(
+  $form['body'] = array(
     '#type'               => 'textarea',
     '#title'              => t('Message'),
     '#rows'               => 6,
@@ -293,14 +293,14 @@ function privatemsg_new(&$form_state, $r
   if (isset($form_state['values']) && array_key_exists('format', $form_state['values'])) {
     $format = $form_state['values']['format'];
   }
-  $form['privatemsg']['format'] = filter_form($format);
-  $form['privatemsg']['preview'] = array(
+  $form['format'] = filter_form($format);
+  $form['preview'] = array(
     '#type'               => 'submit',
     '#value'              => t('Preview message'),
     '#submit'             => array('privatemsg_new_preview'),
     '#weight'             => 10,
   );
-  $form['privatemsg']['submit'] = array(
+  $form['submit'] = array(
     '#type'               => 'submit',
     '#value'              => t('Send message'),
     '#weight'             => 15,
@@ -315,31 +315,31 @@ function privatemsg_new(&$form_state, $r
     $title = t('Clear');
   }
 
-  $form['privatemsg']['cancel'] = array(
+  $form['cancel'] = array(
     '#value'              => l($title, $url, array('attributes' => array('id' => 'edit-cancel'))),
     '#weight'             => 20,
   );
 
   if (!is_null($thread_id)) {
-    $form['privatemsg']['thread_id'] = array(
+    $form['thread_id'] = array(
       '#type' => 'value',
       '#value' => $thread_id,
     );
-    $form['privatemsg']['subject'] = array(
+    $form['subject'] = array(
       '#type' => 'value',
       '#default_value' => $subject,
     );
     $recipients_string_themed = implode(', ', $to_themed);
-    $form['privatemsg']['recipient_display'] = array(
+    $form['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;
+      $form['#access'] = FALSE;
     }
   }
-  $form['privatemsg']['read_all'] = array(
+  $form['read_all'] = array(
     '#type'  => 'value',
     '#value' => $read_all,
   );
Index: privatemsg_attachments/privatemsg_attachments.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg_attachments/privatemsg_attachments.module,v
retrieving revision 1.2
diff -u -p -r1.2 privatemsg_attachments.module
--- privatemsg_attachments/privatemsg_attachments.module	20 Feb 2010 08:57:56 -0000	1.2
+++ privatemsg_attachments/privatemsg_attachments.module	23 Feb 2010 16:19:39 -0000
@@ -18,7 +18,7 @@ function privatemsg_attachments_perm() {
  */
 function privatemsg_attachments_form_privatemsg_new_alter(&$form, &$form_state) {
   if (user_access('upload private message attachments')) {
-    $form['privatemsg']['attachments'] = array(
+    $form['attachments'] = array(
         '#type' => 'fieldset',
         '#access' => user_access('upload private message attachments'),
         '#title' => t('File attachments'),
@@ -31,7 +31,7 @@ function privatemsg_attachments_form_pri
     );
 
     // Wrapper for fieldset contents (used by ahah.js).
-    $form['privatemsg']['attachments']['wrapper'] = array(
+    $form['attachments']['wrapper'] = array(
         '#prefix' => '<div id="attach-wrapper">',
         '#suffix' => '</div>',
     );
@@ -48,22 +48,22 @@ function privatemsg_attachments_form_pri
 
     // Note: pass by reference
     if (!file_check_directory($path, FILE_CREATE_DIRECTORY) || !file_check_directory($temp, FILE_CREATE_DIRECTORY)) {
-      $form['privatemsg']['attachments']['#description'] =  t('File attachments are disabled. The file directories have not been properly configured.');
+      $form['attachments']['#description'] =  t('File attachments are disabled. The file directories have not been properly configured.');
       if (user_access('administer site configuration')) {
-        $form['privatemsg']['attachments']['#description'] .= ' '. t('Please visit the <a href="@admin-file-system">file system configuration page</a>.', array('@admin-file-system' => url('admin/settings/file-system')));
+        $form['attachments']['#description'] .= ' '. t('Please visit the <a href="@admin-file-system">file system configuration page</a>.', array('@admin-file-system' => url('admin/settings/file-system')));
       }
       else {
-        $form['privatemsg']['attachments']['#description'] .= ' '. t('Please contact the site administrator.');
+        $form['attachments']['#description'] .= ' '. t('Please contact the site administrator.');
       }
     }
     else {
       $files = array();
       if (!empty($form_state['values']['files'])) {
         $files = $form_state['values']['files'];
-        $form['privatemsg']['attachments']['#collapsed'] = FALSE;
+        $form['attachments']['#collapsed'] = FALSE;
       }
 
-      $form['privatemsg']['attachments']['wrapper'] += _privatemsg_attachments_form($files);
+      $form['attachments']['wrapper'] += _privatemsg_attachments_form($files);
       // Execute submit function as validate, to have it executed before
       // $form_state['validate_built_message'] is created.
       array_unshift($form['#validate'], '_privatemsg_attachments_upload_submit');
