You are here

function custom_spamapi in Spam 5.3

Spam API Hook

File

filters/custom/custom.module, line 32

Code

function custom_spamapi($op, $type = NULL, $content = array(), $fields = array(), $extra = NULL) {
  switch ($op) {
    case 'filter':
      if (!module_invoke('spam', 'filter_enabled', 'custom', $type, $content, $fields, $extra)) {
        return;
      }
      return custom_spam_filter($content, $type, $fields, $extra);
    case 'filter_module':
      return 'custom';
    case 'filter_info':
      return array(
        'name' => t('Custom filter'),
        'module' => t('custom'),
        'description' => t('Custom spam filters.'),
        'help' => t('The custom spam filter module allows you to manually define custom spam filter rules.'),
      );
    case 'filter_install':
      return array(
        'status' => SPAM_FILTER_ENABLED,
        'gain' => 250,
        'weight' => -4,
      );
  }
}