delete spam score on deleted notice

This commit is contained in:
Evan Prodromou 2012-03-05 09:09:14 -06:00
parent ec7a3c80e5
commit 1d46a1288f
1 changed files with 8 additions and 0 deletions

View File

@ -155,6 +155,14 @@ class ActivitySpamPlugin extends Plugin
return true;
}
function onNoticeDeleteRelated($notice) {
$score = Spam_score::staticGet('notice_id', $notice->id);
if (!empty($score)) {
$score->delete();
}
return true;
}
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'ActivitySpam',