Index: mollom.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.css,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 mollom.css
--- mollom.css	14 Sep 2010 20:28:45 -0000	1.1.2.4
+++ mollom.css	20 Oct 2010 16:26:12 -0000
@@ -4,6 +4,16 @@
   display: block;
 }
 
+.mollom-info .form-item {
+  margin-top: 0.3em;
+  margin-bottom: 0.3em;
+  overflow: hidden;
+}
+.mollom-info .form-item label {
+  float: left;
+  width: 12em;
+}
+
 /* Help themes to properly display Mollom's log messages. */
 .dblog-event pre,
 #simpletest-result-form table td {
Index: mollom.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.install,v
retrieving revision 1.2.2.35
diff -u -p -r1.2.2.35 mollom.install
--- mollom.install	16 Oct 2010 18:24:54 -0000	1.2.2.35
+++ mollom.install	21 Oct 2010 14:30:50 -0000
@@ -136,6 +136,12 @@ function mollom_schema() {
         'size' => 'tiny',
         'not null' => FALSE,
       ),
+      'sentiment' => array(
+        'description' => 'Text analysis sentiment check result.',
+        'type' => 'float',
+        'size' => 'tiny',
+        'not null' => FALSE,
+      ),
       'languages' => array(
         'description' => 'Text analysis language check result.',
         'type' => 'varchar',
@@ -634,3 +640,19 @@ function mollom_update_6117() {
   }
   return $ret;
 }
+
+/**
+ * Add {mollom}.sentiment text analysis check column.
+ */
+function mollom_update_6118() {
+  $ret = array();
+  if (!db_column_exists('mollom', 'sentiment')) {
+    db_add_field($ret, 'mollom', 'sentiment', array(
+      'description' => 'Text analysis sentiment check result.',
+      'type' => 'float',
+      'size' => 'tiny',
+      'not null' => FALSE,
+    ));
+  }
+  return $ret;
+}
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.2.2.178
diff -u -p -r1.2.2.178 mollom.module
--- mollom.module	18 Oct 2010 14:04:54 -0000	1.2.2.178
+++ mollom.module	21 Oct 2010 14:46:51 -0000
@@ -2540,6 +2540,73 @@ function mollom_comment($comment, $op) {
   if ($op == 'delete') {
     mollom_data_delete('comment', $comment->cid);
   }
+  if ($op == 'view') {
+    $comment->mollom = mollom_data_load('comment', $comment->cid);
+  }
+}
+
+function mollom_preprocess_comment(&$variables) {
+  if (user_access('bypass mollom protection') && !empty($variables['comment']->mollom)) {
+    $data = $variables['comment']->mollom;
+    $labels_spam = array(
+      MOLLOM_ANALYSIS_HAM => t('Ham'),
+      MOLLOM_ANALYSIS_SPAM => t('Spam'),
+      MOLLOM_ANALYSIS_UNSURE => t('Unsure'),
+    );
+
+    $form['mollom_info'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Text analysis'),
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#attributes' => array('class' => 'mollom-info'),
+    );
+    $form['mollom_info']['session_id'] = array(
+      '#type' => 'item',
+      '#title' => t('Session id'),
+      '#value' => check_plain($data->session_id),
+      // D6: drupal_render() requires at least one element with a non-zero
+      // #weight to trigger sorting of elements.
+      '#weight' => -1,
+    );
+    if (isset($data->spam)) {
+      $form['mollom_info']['spam'] = array(
+        '#type' => 'item',
+        '#title' => t('Spam'),
+        '#value' => $labels_spam[$data->spam],
+      );
+    }
+    if (isset($data->quality)) {
+      $form['mollom_info']['quality'] = array(
+        '#type' => 'item',
+        '#title' => t('Quality'),
+        '#value' => check_plain($data->quality),
+      );
+    }
+    if (isset($data->profanity)) {
+      $form['mollom_info']['profanity'] = array(
+        '#type' => 'item',
+        '#title' => t('Profanity'),
+        '#value' => check_plain($data->profanity),
+      );
+    }
+    if (isset($data->sentiment)) {
+      $form['mollom_info']['sentiment'] = array(
+        '#type' => 'item',
+        '#title' => t('Sentiment'),
+        '#value' => check_plain($data->sentiment),
+      );
+    }
+    if (isset($data->languages)) {
+      $form['mollom_info']['languages'] = array(
+        '#type' => 'item',
+        '#title' => t('Languages'),
+        '#value' => check_plain($data->languages),
+      );
+    }
+    $output = drupal_render($form);
+    $variables['content'] .= $output;
+  }
 }
 
 /**
