From 76e6dd00adae7d1ba1d74f77ff753b8a0383281d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 19 Mar 2012 11:53:53 -0400 Subject: [PATCH] always rw --- ActivitySpamPlugin.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ActivitySpamPlugin.php b/ActivitySpamPlugin.php index 5e13d3610f..fddad37028 100644 --- a/ActivitySpamPlugin.php +++ b/ActivitySpamPlugin.php @@ -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; + } }