Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.68
diff -u -p -r1.68 mollom.module
--- mollom.module	26 Aug 2010 21:37:58 -0000	1.68
+++ mollom.module	3 Sep 2010 11:33:42 -0000
@@ -1055,7 +1055,7 @@ function _mollom_status($reset = FALSE) 
 
   // If we have keys and are asked to reset, check whether keys are valid.
   if ($status['keys'] && $reset) {
-    $status['keys valid'] = mollom('mollom.verifyKey');
+    $status['keys valid'] = mollom('mollom.verifyKey', _mollom_get_version());
   }
 
   // In case of an error, indicate whether we have a non-empty server list.
@@ -1565,6 +1565,58 @@ function _mollom_watchdog($messages, $se
 }
 
 /**
+ * Returns version information to send with mollom.verifyKey.
+ *
+ * Retrieves platform and module version information for mollom.verifyKey, which
+ * is normally invoked on Mollom's administration pages only.
+ *
+ * This information is solely used to speed up support requests and technical
+ * inquiries. The data may also be aggregated to help the Mollom staff to make
+ * decisions on new features or the necessity of back-porting improved
+ * functionality to older versions.
+ *
+ * @return
+ *   An array containing:
+ *   - platform_name: The name of the Drupal distribution; i.e., "Drupal".
+ *   - platform_version: The version of Drupal; e.g., "7.0".
+ *   - client_name: The module name; i.e., "Mollom".
+ *   - client_version: The version of the module; e.g., "7.x-1.0".
+ *
+ * @see _mollom_status()
+ */
+function _mollom_get_version() {
+  if ($cache = cache_get('mollom_version')) {
+    return $cache->data;
+  }
+
+  // Retrieve Drupal distribution and installation profile information.
+  include_once DRUPAL_ROOT . '/includes/install.inc';
+  $profile = drupal_get_profile();
+  $profile_info = install_profile_info($profile);
+  if (empty($profile_info['version'])) {
+    $profile_info['version'] = VERSION;
+  }
+
+  // Retrieve Mollom module information.
+  $mollom_info = db_query("SELECT info FROM {system} WHERE type = 'module' AND name = 'mollom'")->fetchField();
+  $mollom_info = unserialize($mollom_info);
+  if (empty($mollom_info['version'])) {
+    // Manually build a module version string for repository checkouts.
+    $mollom_info['version'] = DRUPAL_CORE_COMPATIBILITY . '-1.x-dev';
+  }
+
+  $data = array(
+    'platform_name' => $profile_info['distribution_name'],
+    'platform_version' => $profile_info['version'],
+    'client_name' => $mollom_info['name'],
+    'client_version' => $mollom_info['version'],
+  );
+  cache_set('mollom_version', $data);
+
+  return $data;
+}
+
+/**
  * Send feedback to Mollom.
  */
 function _mollom_send_feedback($session_id, $feedback = 'spam') {
Index: tests/mollom.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/tests/mollom.test,v
retrieving revision 1.53
diff -u -p -r1.53 mollom.test
--- tests/mollom.test	1 Sep 2010 10:45:55 -0000	1.53
+++ tests/mollom.test	3 Sep 2010 11:44:41 -0000
@@ -2349,6 +2349,23 @@ class MollomDataTestCase extends MollomW
     $count = db_query("SELECT COUNT(1) FROM {mollom}")->fetchField();
     $this->assertEqual($count, 1, t('Stored data in {mollom} was updated.'));
   }
+
+  /**
+   * Tests data sent for mollom.verifyKey.
+   */
+  function testVerifyKey() {
+    $this->drupalLogin($this->admin_user);
+    $this->drupalGet('admin/config/content/mollom/settings');
+
+    // Verify that we additionally sent version data.
+    $data = $this->getServerRecord('mollom.verifyKey');
+    $info = _mollom_get_version();
+    $this->assertTrue(!empty($info['platform_name']), t('Version information found.'));
+    $this->assertSame('platform_name', $data['platform_name'], $info['platform_name']);
+    $this->assertSame('platform_version', $data['platform_version'], $info['platform_version']);
+    $this->assertSame('client_name', $data['client_name'], $info['client_name']);
+    $this->assertSame('client_version', $data['client_version'], $info['client_version']);
+  }
 }
 
 /**
