]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
delete spam score on deleted notice
authorEvan Prodromou <evan@status.net>
Mon, 5 Mar 2012 15:09:14 +0000 (09:09 -0600)
committerEvan Prodromou <evan@status.net>
Mon, 5 Mar 2012 15:09:14 +0000 (09:09 -0600)
ActivitySpamPlugin.php

index 63ac94ef5f17dd71dea7bb402003554527ad3f94..6c1f8df472e2d28c453b2ed06ac339040d204657 100644 (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',