]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Hide spam notices
authorEvan Prodromou <evan@status.net>
Wed, 21 Mar 2012 00:48:47 +0000 (20:48 -0400)
committerEvan Prodromou <evan@status.net>
Wed, 21 Mar 2012 00:48:47 +0000 (20:48 -0400)
ActivitySpamPlugin.php

index fddad37028cb0d793433b59684c3b32ce707d02a..b29401625920ed0e88eb9959d4658a595d6f54b6 100644 (file)
@@ -278,4 +278,22 @@ class ActivitySpamPlugin extends Plugin
         $alwaysRW[] = 'spam_score';
         return true;
     }
+
+    function onEndNoticeInScope($notice, $profile, &$bResult)
+    {
+        if ($bResult) {
+
+            $score = $this->getScore($notice);
+
+            if ($score->is_spam) {
+                if (empty($profile) ||
+                    ($profile->id !== $notice->profile_id &&
+                     !$profile->hasRight(self::REVIEWSPAM))) {
+                    $bResult = false;
+                }
+            }
+        }
+
+        return $true;
+    }
 }