From d016ce846e9befc9c38f623c6ab9488d4a347fdd Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 20 Mar 2012 20:48:47 -0400 Subject: [PATCH] Hide spam notices --- ActivitySpamPlugin.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ActivitySpamPlugin.php b/ActivitySpamPlugin.php index fddad37028..b294016259 100644 --- a/ActivitySpamPlugin.php +++ b/ActivitySpamPlugin.php @@ -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; + } } -- 2.39.5