? .cvsignore
? privatemsg_mollom.patch
? privatemsg_mollom2.patch
? privatemsg_mollom3.patch
? privatemsg_mollom4.patch
Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.132
diff -u -p -r1.132 privatemsg.module
--- privatemsg.module	6 Jun 2010 15:52:50 -0000	1.132
+++ privatemsg.module	6 Jun 2010 18:09:34 -0000
@@ -30,6 +30,7 @@ function privatemsg_perm() {
     'administer privatemsg settings',
     'write privatemsg',
     'delete privatemsg',
+    'report private messages to mollom',
   );
 }
 
@@ -1943,4 +1944,39 @@ function privatemsg_views_api() {
     'api' => 2,
     'path' => drupal_get_path('module', 'privatemsg') . '/views',
   );
-}
\ No newline at end of file
+}
+
+/**
+ * Implements hook_mollom_form_info().
+ */
+function privatemsg_mollom_form_info() {
+  $form_info = array(
+    'title' => t('Send new message form'),
+    'mode' => MOLLOM_MODE_ANALYSIS,
+    'bypass access' => array('administer privatemsg'),
+    'report access' => 'report private messages to mollom',
+    'entity' => 'privatemsg_message',
+    'elements' => array(
+      'subject' => t('Subject'),
+      'body' => t('Body'),
+    ),
+    'mapping' => array(
+      'post_id' => 'mid',
+      'post_title' => 'subject',
+    ),
+  );
+
+  return $form_info;
+}
+
+/**
+ * Implements hook_mollom_form_list().
+ */
+function privatemsg_mollom_form_list() {
+  $forms['privatemsg_new'] = array(
+    'title' => t('Send new message form'),
+    'entity' => 'privatemsg_message',
+    'delete form' => 'privatemsg_delete',
+  );
+  return $forms;
+}
Index: privatemsg.pages.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.pages.inc,v
retrieving revision 1.4
diff -u -p -r1.4 privatemsg.pages.inc
--- privatemsg.pages.inc	6 Jun 2010 15:13:47 -0000	1.4
+++ privatemsg.pages.inc	6 Jun 2010 18:09:35 -0000
@@ -254,16 +254,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.'),
@@ -275,7 +275,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,
@@ -283,7 +283,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,
@@ -297,14 +297,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,
@@ -319,31 +319,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,
   );
@@ -411,7 +411,7 @@ function privatemsg_new_preview($form, &
 
 
 function privatemsg_delete($form_state, $thread, $message) {
-  $form['pmid'] = array(
+  $form['mid'] = array(
     '#type' => 'value',
     '#value' => $message['mid'],
   );
@@ -443,11 +443,11 @@ function privatemsg_delete_submit($form,
 
   if ($form_state['values']['confirm']) {
     if (isset($form_state['values']['delete_options']) && $form_state['values']['delete_options']) {
-      privatemsg_message_change_delete($form_state['values']['pmid'], 1);
+      privatemsg_message_change_delete($form_state['values']['mid'], 1);
       drupal_set_message(t('Message has been deleted for all users.'));
     }
     else {
-      privatemsg_message_change_delete($form_state['values']['pmid'], 1, $account);
+      privatemsg_message_change_delete($form_state['values']['mid'], 1, $account);
       drupal_set_message(t('Message has been deleted.'));
     }
   }
Index: privatemsg_attachments/privatemsg_attachments.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg_attachments/privatemsg_attachments.module,v
retrieving revision 1.4
diff -u -p -r1.4 privatemsg_attachments.module
--- privatemsg_attachments/privatemsg_attachments.module	5 May 2010 20:54:19 -0000	1.4
+++ privatemsg_attachments/privatemsg_attachments.module	6 Jun 2010 18:09:35 -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');
