Index: mollom.api.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.api.php,v
retrieving revision 1.5
diff -u -p -r1.5 mollom.api.php
--- mollom.api.php	5 Aug 2010 01:31:04 -0000	1.5
+++ mollom.api.php	12 Sep 2010 19:49:51 -0000
@@ -148,9 +148,6 @@
  *   switch ($form_id) {
  *     case 'im_message_form':
  *       $form_info = array(
- *         // Identical to hook_mollom_form_list():
- *         'title' => t('Instant messaging form'),
- *         'entity' => 'im',
  *         // Optional: User permission list to skip Mollom's protection for.
  *         'bypass access' => array('administer instant messages'),
  *         // Optional: To allow textual analysis of the form values, the form
@@ -226,7 +223,12 @@
  *   protected, keyed by $form_id:
  *   - title: The human-readable name of the form.
  *   - entity: (optional) The internal name of the entity type the form is for,
- *     e.g. 'node' or 'comment'. See hook_mollom_form_info() for details.
+ *     e.g. 'node' or 'comment'. This is required for all forms that will store
+ *     the submitted content persistently. It is only optional for forms that do
+ *     not permanently store the submitted form values, such as contact forms
+ *     that only send an e-mail, but do not store it in the database.
+ *     Note that forms that specify 'entity' also need to specify 'post_id' in
+ *     the 'mapping' (see below).
  *   - report access callback: (optional) A function name to invoke to check
  *     access to Mollom's dedicated "report to Mollom" form, which should return
  *     either TRUE or FALSE (like any other menu "access callback").
@@ -265,7 +267,6 @@ function hook_mollom_form_list() {
  *
  * @return
  *   An associative array describing the form identified by $form_id:
- *   - title: The human-readable name of the form.
  *   - mode: (optional) The default protection mode for the form, which can be
  *     one of:
  *     - MOLLOM_MODE_ANALYSIS: Text analysis of submitted form values with
@@ -280,13 +281,6 @@ function hook_mollom_form_list() {
  *     Mollom' link will be included at the bottom of the mail body. Be sure to
  *     include only user-submitted mails and not any mails sent by Drupal since
  *     they should never be reported as spam.
- *   - entity: (optional) The internal name of the entity type the form is for,
- *     e.g. 'node' or 'comment'. This is required for all forms that will store
- *     the submitted content persistently. It is only optional for forms that do
- *     not permanently store the submitted form values, such as contact forms
- *     that only send an e-mail, but do not store it in the database.
- *     Note that forms that specify 'entity' also need to specify 'post_id' in
- *     the 'mapping' (see below).
  *   - elements: (optional) An associative array of elements in the form that
  *     can be configured for Mollom's text analysis. The site administrator can
  *     only select the form elements to process (and exclude certain elements)
@@ -328,11 +322,9 @@ function hook_mollom_form_info($form_id)
     // Mymodule's comment form.
     case 'mymodule_comment_form':
       $form_info = array(
-        'title' => t('Comment form'),
         'mode' => MOLLOM_MODE_ANALYSIS,
         'bypass access' => array('administer comments'),
         'mail ids' => array('mymodule_comment_mail'),
-        'entity' => 'comment',
         'elements' => array(
           'subject' => t('Subject'),
           'body' => t('Body'),
@@ -350,9 +342,7 @@ function hook_mollom_form_info($form_id)
     // Mymodule's user registration form.
     case 'mymodule_user_register':
       $form_info = array(
-        'title' => t('User registration form'),
         'mode' => MOLLOM_MODE_CAPTCHA,
-        'entity' => 'user',
         'mapping' => array(
           'post_id' => 'uid',
           'author_name' => 'name',
Index: mollom.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.install,v
retrieving revision 1.24
diff -u -p -r1.24 mollom.install
--- mollom.install	10 Aug 2010 19:33:51 -0000	1.24
+++ mollom.install	12 Sep 2010 19:31:29 -0000
@@ -502,26 +502,6 @@ function mollom_update_7005() {
     db_drop_field('mollom', 'reputation');
   }
 
-  // Add {mollom}.spam.
-  db_add_field('mollom', 'spam', array(
-    'type' => 'int',
-    'size' => 'tiny',
-    'not null' => FALSE,
-  ));
-  // Fill {mollom}.spam with approximate values based on {mollom}.quality.
-  db_update('mollom')
-    ->fields(array('spam' => MOLLOM_ANALYSIS_SPAM))
-    ->condition('quality', 0.5, '<')
-    ->execute();
-  db_update('mollom')
-    ->fields(array('spam' => MOLLOM_ANALYSIS_UNSURE))
-    ->condition('quality', 0.5, '=')
-    ->execute();
-  db_update('mollom')
-    ->fields(array('spam' => MOLLOM_ANALYSIS_HAM))
-    ->condition('quality', 0.5, '>')
-    ->execute();
-
   // Change {mollom}.quality from varchar into float.
   db_change_field('mollom', 'quality', 'quality', array(
     'type' => 'float',
@@ -529,10 +509,39 @@ function mollom_update_7005() {
     'not null' => FALSE,
   ));
 
+  // Add {mollom}.spam.
+  if (!db_field_exists('mollom', 'spam')) {
+    db_add_field('mollom', 'spam', array(
+      'type' => 'int',
+      'size' => 'tiny',
+      'not null' => FALSE,
+    ));
+    // Fill {mollom}.spam with approximate values based on {mollom}.quality.
+    // Note that this is just to have some values. 'quality' and 'spam' are
+    // completely unrelated otherwise.
+    // MOLLOM_ANALYSIS_SPAM
+    db_update('mollom')
+      ->fields(array('spam' => 2))
+      ->condition('quality', 0.5, '<')
+      ->execute();
+    // MOLLOM_ANALYSIS_UNSURE
+    db_update('mollom')
+      ->fields(array('spam' => 3))
+      ->condition('quality', 0.5, '=')
+      ->execute();
+    // MOLLOM_ANALYSIS_HAM
+    db_update('mollom')
+      ->fields(array('spam' => 1))
+      ->condition('quality', 0.5, '>')
+      ->execute();
+  }
+
   // Add {mollom}.profanity.
-  db_add_field('mollom', 'profanity', array(
-    'type' => 'float',
-    'size' => 'tiny',
-    'not null' => FALSE,
-  ));
+  if (!db_field_exists('mollom', 'profanity')) {
+    db_add_field('mollom', 'profanity', array(
+      'type' => 'float',
+      'size' => 'tiny',
+      'not null' => FALSE,
+    ));
+  }
 }
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.73
diff -u -p -r1.73 mollom.module
--- mollom.module	12 Sep 2010 18:12:50 -0000	1.73
+++ mollom.module	12 Sep 2010 19:48:15 -0000
@@ -763,7 +763,7 @@ function mollom_form_new($form_id = NULL
     }
     $mollom_form += mollom_form_info($form_id, $form_list[$form_id]['module']);
   }
-  // Ensure default properties are defined.
+  // Ensure default properties.
   $mollom_form += array(
     'form_id' => $form_id,
     'title' => $form_id,
@@ -1040,7 +1040,7 @@ function _mollom_get_openid($account) {
  *
  * @param $reset
  *   (optional) Boolean whether to reset the stored state and re-check.
- *   Defaults to FALSE. Only re-checked once per request.
+ *   Defaults to FALSE.
  *
  * @return
  *   TRUE if the module is considered operable, or an associative array
@@ -1049,6 +1049,10 @@ function _mollom_get_openid($account) {
  *   - keys valid: TRUE if Mollom API keys are valid, or the error code as
  *     returned by Mollom servers.
  *   - servers: Boolean whether there is a non-empty list of Mollom servers.
+ *
+ * @see mollom_init()
+ * @see mollom_admin_settings()
+ * @see mollom_requirements()
  */
 function _mollom_status($reset = FALSE) {
   // Load stored status.
@@ -1947,10 +1951,8 @@ function node_mollom_form_info($form_id)
 
   $type = node_type_get_type($nodetype);
   $form_info = array(
-    'title' => t('@name form', array('@name' => $type->name)),
     // @todo This is incompatible with node access.
     'bypass access' => array('bypass node access', 'edit any ' . $type->type . ' content'),
-    'entity' => 'node',
     'bundle' => $type->type,
     'elements' => array(),
     'mapping' => array(
@@ -2102,10 +2104,8 @@ function user_mollom_form_info($form_id)
   switch ($form_id) {
     case 'user_register_form':
       $form_info = array(
-        'title' => t('User registration form'),
         'mode' => MOLLOM_MODE_CAPTCHA,
         'bypass access' => array('administer users'),
-        'entity' => 'user',
         'mapping' => array(
           'post_id' => 'uid',
           'author_name' => 'name',
@@ -2116,10 +2116,8 @@ function user_mollom_form_info($form_id)
 
     case 'user_pass':
       $form_info = array(
-        'title' => t('User password request form'),
         'mode' => MOLLOM_MODE_CAPTCHA,
         'bypass access' => array('administer users'),
-        'entity' => 'user',
         'mapping' => array(
           'post_id' => 'uid',
           'author_name' => 'name',
@@ -2182,7 +2180,6 @@ function contact_mollom_form_info($form_
   switch ($form_id) {
     case 'contact_site_form':
       $form_info = array(
-        'title' => t('Site-wide contact form'),
         'mode' => MOLLOM_MODE_ANALYSIS,
         'bypass access' => array('administer site-wide contact form'),
         'mail ids' => array('contact_page_mail'),
@@ -2200,7 +2197,6 @@ function contact_mollom_form_info($form_
 
     case 'contact_personal_form':
       $form_info = array(
-        'title' => t('User contact form'),
         'mode' => MOLLOM_MODE_ANALYSIS,
         'bypass access' => array('administer users'),
         'mail ids' => array('contact_user_mail'),
Index: tests/mollom.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/tests/mollom.test,v
retrieving revision 1.56
diff -u -p -r1.56 mollom.test
--- tests/mollom.test	12 Sep 2010 00:11:49 -0000	1.56
+++ tests/mollom.test	12 Sep 2010 20:15:56 -0000
@@ -752,7 +752,7 @@ class MollomInstallationTestCase extends
     $this->drupalLogin($this->web_user);
     $this->drupalGet('comment/reply/' . $node->nid);
     $edit = array(
-      'comment_body[und][0][value]' => $this->randomName(),
+      'comment_body[und][0][value]' => 'spam',
     );
     $this->drupalPost(NULL, $edit, t('Preview'));
     $this->drupalPost(NULL, array(), t('Save'));
@@ -1978,7 +1978,10 @@ class MollomCommentFormTestCase extends 
     $this->assertPrivacyLink();
 
     // Try to save a comment that is 'unsure' and make sure there is a CAPTCHA.
-    $this->drupalPost(NULL, array('comment_body[und][0][value]' => 'unsure'), t('Save'));
+    $edit = array(
+      'comment_body[und][0][value]' => 'unsure',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
     $this->assertCaptchaField();
     $session_id = $this->assertSessionIDInForm();
     $this->assertPrivacyLink();
@@ -1993,8 +1996,8 @@ class MollomCommentFormTestCase extends 
 
     // Correctly solving the CAPTCHA should accept the form submission.
     $this->postCorrectCaptcha(NULL, array(), t('Save'));
-    $this->assertRaw('<p>unsure</p>', t('A comment that may contain spam was found.'));
-    $cid = db_query('SELECT cid FROM {comment} WHERE subject = :subject ORDER BY created DESC', array(':subject' => 'unsure'))->fetchField();
+    $this->assertRaw('<p>' . $edit['comment_body[und][0][value]'] . '</p>', t('A comment that may contain spam was found.'));
+    $cid = db_query('SELECT cid FROM {comment} WHERE subject = :subject ORDER BY created DESC', array(':subject' => $edit['comment_body[und][0][value]']))->fetchField();
     $this->assertMollomData('comment', $cid, $session_id);
 
     // Try to save a new 'spam' comment; it should be rejected, with no CAPTCHA
