From: Evan Prodromou Date: Mon, 19 Mar 2012 15:53:53 +0000 (-0400) Subject: always rw X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=76e6dd00adae7d1ba1d74f77ff753b8a0383281d;p=quix0rs-gnu-social.git always rw --- 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 { + + $result = $this->filter->test($notice); + + $score = Spam_score::saveNew($notice, $result); + + $this->log(LOG_INFO, "Notice " . $notice->id . " has spam score " . $score->score); - $score = Spam_score::saveNew($notice, $result); + } 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; + } }