Index: mollom.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.admin.inc,v
retrieving revision 1.37
diff -u -p -r1.37 mollom.admin.inc
--- mollom.admin.inc	16 Sep 2010 19:06:52 -0000	1.37
+++ mollom.admin.inc	19 Sep 2010 02:23:15 -0000
@@ -390,13 +390,33 @@ function mollom_admin_blacklist_form($fo
  * Form submit handler to save a text string to the Mollom blacklist.
  */
 function mollom_admin_blacklist_form_submit($form, &$form_state) {
-  $result = mollom('mollom.addBlacklistText', $form_state['values']['entry']);
-
+  $data = array(
+    'text' => $form_state['values']['entry']['text'],
+    'context' => $form_state['values']['entry']['context'],
+    'reason' => $form_state['values']['entry']['reason'],
+  );
+  $result = mollom('mollom.addBlacklistText', $data);
+
+  $args = array(
+    '@text' => $data['text'],
+    '@context' => $data['context'],
+    '@reason' => $data['reason'],
+  );
   if ($result === TRUE) {
     drupal_set_message(t('The entry was added to the blacklist.'));
+    _mollom_watchdog(array(
+      'Added @text (@context) to @reason blacklist.' => $args,
+      'Data:<pre>@data</pre>' => array('@data' => $data),
+      'Result:<pre>@result</pre>' => array('@result' => $result),
+    ));
   }
   else {
     drupal_set_message(t('An error occurred upon trying to add the text to the blacklist.'), 'error');
+    _mollom_watchdog(array(
+      'Failed to add @text (%context) to @reason blacklist.' => $args,
+      'Data:<pre>@data</pre>' => array('@data' => $data),
+      'Result:<pre>@result</pre>' => array('@result' => $result),
+    ), WATCHDOG_ERROR);
   }
 }
 
@@ -481,11 +501,26 @@ function mollom_admin_blacklist_delete_s
   );
   $result = mollom('mollom.removeBlacklistText', $data);
 
+  $args = array(
+    '@text' => $data['text'],
+    '@context' => $data['context'],
+    '@reason' => $data['reason'],
+  );
   if ($result === TRUE) {
     drupal_set_message(t('The entry was removed from the blacklist.'));
+    _mollom_watchdog(array(
+      'Removed @text (@context) from @reason blacklist.' => $args,
+      'Data:<pre>@data</pre>' => array('@data' => $data),
+      'Result:<pre>@result</pre>' => array('@result' => $result),
+    ));
   }
   else {
     drupal_set_message(t('An error occurred upon trying to remove the item from the blacklist.'), 'error');
+    _mollom_watchdog(array(
+      'Failed to removed @text (%context) from @reason blacklist.' => $args,
+      'Data:<pre>@data</pre>' => array('@data' => $data),
+      'Result:<pre>@result</pre>' => array('@result' => $result),
+    ), WATCHDOG_ERROR);
   }
 
   $form_state['redirect'] = 'admin/config/content/mollom/blacklist';
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.81
diff -u -p -r1.81 mollom.module
--- mollom.module	16 Sep 2010 19:06:52 -0000	1.81
+++ mollom.module	19 Sep 2010 02:23:30 -0000
@@ -224,7 +224,7 @@ function mollom_menu() {
     'file' => 'mollom.admin.inc',
   );
   $items['admin/config/content/mollom/blacklist'] = array(
-    'title' => 'Blacklist',
+    'title' => 'Blacklists',
     'description' => 'Configure blacklists.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('mollom_admin_blacklist_form'),
Index: tests/mollom.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/tests/mollom.test,v
retrieving revision 1.59
diff -u -p -r1.59 mollom.test
--- tests/mollom.test	16 Sep 2010 19:06:52 -0000	1.59
+++ tests/mollom.test	19 Sep 2010 02:24:18 -0000
@@ -1300,7 +1300,7 @@ class MollomLanguageDetectionTestCase ex
 class MollomBlacklistTestCase extends MollomWebTestCase {
   public static function getInfo() {
     return array(
-      'name' => 'Blacklisting',
+      'name' => 'Blacklist',
       'description' => 'Tests URL and text blacklist functionality.',
       'group' => 'Mollom',
     );
@@ -1309,7 +1309,7 @@ class MollomBlacklistTestCase extends Mo
   /**
    * Test the URL blacklist functionality at the API level without using a web interface.
    */
-  function xtestUrlBlacklistAPI() {
+  function testUrlBlacklistAPI() {
     // Remove any stale blacklist entries from test runs that did not finish.
     $blacklist = mollom('mollom.listBlacklistURL');
     foreach ($blacklist as $entry) {
@@ -1359,12 +1359,16 @@ class MollomBlacklistTestCase extends Mo
   /**
    * Test the text blacklist functionality at the API level without using a web interface.
    */
-  function xtestTextBlacklistAPI() {
+  function testTextBlacklistAPI() {
     // Remove any stale blacklist entries from test runs that did not finish.
     $blacklist = mollom('mollom.listBlacklistText');
     foreach ($blacklist as $entry) {
       if (strtotime($entry['created']) - REQUEST_TIME > 86400) {
-        mollom('mollom.removeBlacklistText', array('text' => $entry['text']));
+        mollom('mollom.removeBlacklistText', array(
+          'text' => $entry['text'],
+          'context' => $entry['context'],
+          'reason' => $entry['reason'],
+        ));
       }
     }
 
@@ -1373,8 +1377,9 @@ class MollomBlacklistTestCase extends Mo
     $term = drupal_strtolower(preg_replace('/[^a-zA-Z]/', '', $this->randomName()));
     $result = mollom('mollom.addBlacklistText', array(
       'text' => $term,
-      'match' => 'contains',
+      'context' => 'everything',
       'reason' => 'spam',
+      'match' => 'contains',
     ));
     $this->assertIdentical($result, TRUE, t('The text was blacklisted.'));
 
@@ -1394,12 +1399,12 @@ class MollomBlacklistTestCase extends Mo
     ));
     $this->assertEqual($result['spam'], MOLLOM_ANALYSIS_SPAM, t('Partial match was blocked.'));
 
-    // To update the work (i.e. to change the 'match' property), we simply
-    // overwrite it.
+    // Update the blacklist entry to match the term only exactly.
     $result = mollom('mollom.addBlacklistText', array(
       'text' => $term,
-      'match' => 'exact',
+      'context' => 'everything',
       'reason' => 'spam',
+      'match' => 'exact',
     ));
     $this->assertTrue($result, t('The text was blacklisted.'));
 
@@ -1413,8 +1418,20 @@ class MollomBlacklistTestCase extends Mo
     ));
     $this->assertNotEqual($result['spam'], MOLLOM_ANALYSIS_SPAM, t('Partial match was not blocked.'));
 
-    $result = mollom('mollom.removeBlacklistText', array('text' => $term));
+    $result = mollom('mollom.removeBlacklistText', array(
+      'text' => $term,
+      'context' => 'everything',
+      'reason' => 'spam',
+    ));
     $this->assertTrue($result, t('The blacklisted text was removed.'));
+
+    // Try to remove a non-existing entry.
+    $result = mollom('mollom.removeBlacklistText', array(
+      'text' => $term,
+      'context' => 'everything',
+      'reason' => 'spam',
+    ));
+    $this->assertNotIdentical($result, TRUE, t('Error response for a non-existing blacklist text found.'));
   }
 
   /**
@@ -1432,8 +1449,8 @@ class MollomBlacklistTestCase extends Mo
     $this->drupalGet('admin/config/content/mollom/blacklist');
     $text = $this->randomName();
     $edit = array(
-      'entry[context]' => 'everything',
       'entry[text]' => $text,
+      'entry[context]' => 'everything',
     );
     $this->drupalPost(NULL, $edit, t('Add'));
     $this->assertText(t('The entry was added to the blacklist.'));
@@ -1453,8 +1470,8 @@ class MollomBlacklistTestCase extends Mo
     $this->drupalGet('admin/config/content/mollom/blacklist/profanity');
     $text = $this->randomName();
     $edit = array(
-      'entry[context]' => 'everything',
       'entry[text]' => $text,
+      'entry[context]' => 'everything',
     );
     $this->drupalPost(NULL, $edit, t('Add'));
     $this->assertText(t('The entry was added to the blacklist.'));
