--- trackback.module.orig	2005-02-06 00:50:39.000000000 -0500
+++ trackback.module	2005-02-06 10:57:07.158310386 -0500
@@ -30,6 +30,15 @@ function trackback_receive(&$node) {
     db_query('INSERT INTO {trackback_received} (nid, cid, url) VALUES (%d, %d, \'%s\')', $node->nid, $cid, $trackback->url);
     _comment_update_node_statistics($node->nid);
     $error = 0;
+
+    if (function_exists('spam_check') && variable_get('trackback_spam_filter', 1)) {
+      // cid, subject and comment are used by spam_check()
+      $comment->cid = $cid;
+      $comment->subject = $subject;
+      // put everything we want to check for spam in the comment body
+      $comment->comment = $trackback->url .' '. $trackback->name .' '. $trackback->excerpt;
+      spam_check($comment, 'comment', 'subject', 'spam_comment_actions', 'insert');
+    }
   }
   else {
     $error = 1;
@@ -260,6 +269,14 @@ function _trackback_url_parsable_content
   return (substr_count($content_type, 'text/html') || substr_count($content_type, 'application/xhtml+xml') || substr_count($content_type, 'application/xml') || substr_count($content_type, 'text/xml')); 
 }
 
-
+function trackback_spam($op, $a2, $a3, $a4) {
+  $return = array();
+  switch ($op) {
+    case 'filter_settings':
+      $return['group'] = form_checkbox(t('Filter trackbacks'), 'trackback_spam_filter', 1, variable_get('trackback_spam_filter', 1), t('If checked, the spam module will check all new trackbacks that are posted to this site and attempt to determine whether or not they are spam.  Trackbacks are actually comments, so any limits defined below for comments will also apply to trackbacks.'));
+      break;
+  }
+  return $return;
+}
 
 ?>
