Index: mollom.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.info,v
retrieving revision 1.5
diff -u -p -r1.5 mollom.info
--- mollom.info	22 Dec 2009 08:10:34 -0000	1.5
+++ mollom.info	2 Sep 2010 15:25:28 -0000
@@ -8,3 +8,6 @@ files[] = mollom.pages.inc
 files[] = mollom.install
 files[] = tests/mollom.test
 configure = admin/config/content/mollom
+
+; Dummy version required for testing. Do not remove.
+version = 7.x-1.x-dev
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	2 Sep 2010 15:35:36 -0000
@@ -1429,6 +1429,12 @@ function mollom($method, $data = array()
     $data['testing'] = TRUE;
   }
 
+  // Add statistical data for mollom.verifyKey, which is normally invoked on
+  // Mollom's administration pages only.
+  if ($method == 'mollom.verifyKey') {
+    $data += _mollom_get_version();
+  }
+
   // Retrieve the list of Mollom servers from the database.
   $servers = variable_get('mollom_servers', array());
 
@@ -1565,6 +1571,47 @@ function _mollom_watchdog($messages, $se
 }
 
 /**
+ * Returns version information to send with mollom.verifyKey.
+ *
+ * @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".
+ */
+function _mollom_get_version() {
+  $data = &drupal_static('mollom_version');
+
+  if (isset($data)) {
+    return $data;
+  }
+  if ($cache = cache_get('mollom_version')) {
+    $data = $cache->data;
+    return $data;
+  }
+
+  // Fetch Drupal distribution/installation profile information.
+  include_once DRUPAL_ROOT . '/includes/install.inc';
+  $profile = drupal_get_profile();
+  $profile_info = install_profile_info($profile);
+
+  // Fetch Mollom module information.
+  $mollom_info = db_query("SELECT info FROM {system} WHERE type = 'module' AND name = 'mollom'")->fetchField();
+  $mollom_info = unserialize($mollom_info);
+
+  $data = array(
+    'platform_name' => $profile_info['distribution_name'],
+    'platform_version' => isset($profile_info['version']) ? $profile_info['version'] : 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') {
