forked from GNUsocial/gnu-social
always rw
This commit is contained in:
parent
cfef7af2ae
commit
76e6dd00ad
@ -257,10 +257,25 @@ class ActivitySpamPlugin extends Plugin
|
|||||||
return $score;
|
return $score;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
$result = $this->filter->test($notice);
|
$result = $this->filter->test($notice);
|
||||||
|
|
||||||
$score = Spam_score::saveNew($notice, $result);
|
$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;
|
return $score;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onStartReadWriteTables(&$alwaysRW, &$rwdb) {
|
||||||
|
$alwaysRW[] = 'spam_score';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user