From: Evan Prodromou Date: Wed, 21 Mar 2012 00:48:47 +0000 (-0400) Subject: Hide spam notices X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d016ce846e9befc9c38f623c6ab9488d4a347fdd;p=quix0rs-gnu-social.git Hide spam notices --- 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; + } }