From 6f2f302004d4508c5aefec61942c54f2450dd824 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 20 Mar 2012 21:37:35 -0400 Subject: [PATCH] Only hide spam if set --- ActivitySpamPlugin.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ActivitySpamPlugin.php b/ActivitySpamPlugin.php index b294016259..6dde92759d 100644 --- a/ActivitySpamPlugin.php +++ b/ActivitySpamPlugin.php @@ -47,6 +47,7 @@ if (!defined('STATUSNET')) { class ActivitySpamPlugin extends Plugin { public $server = null; + public $hideSpam = false; const REVIEWSPAM = 'ActivitySpamPlugin::REVIEWSPAM'; const TRAINSPAM = 'ActivitySpamPlugin::TRAINSPAM'; @@ -62,6 +63,8 @@ class ActivitySpamPlugin extends Plugin common_config('activityspam', 'consumerkey'), common_config('activityspam', 'secret')); + $this->hideSpam = common_config('activityspam', 'hidespam'); + return true; } @@ -281,15 +284,17 @@ class ActivitySpamPlugin extends Plugin function onEndNoticeInScope($notice, $profile, &$bResult) { - if ($bResult) { + if ($this->hideSpam) { + if ($bResult) { - $score = $this->getScore($notice); + $score = $this->getScore($notice); - if ($score->is_spam) { - if (empty($profile) || - ($profile->id !== $notice->profile_id && - !$profile->hasRight(self::REVIEWSPAM))) { - $bResult = false; + if ($score->is_spam) { + if (empty($profile) || + ($profile->id !== $notice->profile_id && + !$profile->hasRight(self::REVIEWSPAM))) { + $bResult = false; + } } } } -- 2.39.5