From 1d46a1288f3b0fb25bd851272ed320d806330d49 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 5 Mar 2012 09:09:14 -0600 Subject: [PATCH] delete spam score on deleted notice --- ActivitySpamPlugin.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ActivitySpamPlugin.php b/ActivitySpamPlugin.php index 63ac94ef5f..6c1f8df472 100644 --- a/ActivitySpamPlugin.php +++ b/ActivitySpamPlugin.php @@ -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', -- 2.39.5