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	7 Aug 2010 18:45:56 -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.65
diff -u -p -r1.65 mollom.module
--- mollom.module	7 Aug 2010 03:00:12 -0000	1.65
+++ mollom.module	7 Aug 2010 18:46:51 -0000
@@ -1398,6 +1398,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());
 
@@ -1532,6 +1538,45 @@ 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 (!$data = cache_get('mollom_version')) {
+    // 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') {
