always rw

This commit is contained in:
Evan Prodromou 2012-03-19 11:53:53 -04:00
parent cfef7af2ae
commit 76e6dd00ad
1 changed files with 17 additions and 2 deletions

View File

@ -257,10 +257,25 @@ class ActivitySpamPlugin extends Plugin
return $score;
}
$result = $this->filter->test($notice);
try {
$score = Spam_score::saveNew($notice, $result);
$result = $this->filter->test($notice);
$score = Spam_score::saveNew($notice, $result);
$this->log(LOG_INFO, "Notice " . $notice->id . " has spam score " . $score->score);
} catch (Exception $e) {
// Log but continue
$this->log(LOG_ERR, $e->getMessage());
$score = null;
}
return $score;
}
function onStartReadWriteTables(&$alwaysRW, &$rwdb) {
$alwaysRW[] = 'spam_score';
return true;
}
}