Hide spam notices

This commit is contained in:
Evan Prodromou 2012-03-20 20:48:47 -04:00
parent 76e6dd00ad
commit d016ce846e
1 changed files with 18 additions and 0 deletions

View 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;
}
}