class ActivitySpamPlugin extends Plugin
{
public $server = null;
+ public $hideSpam = false;
const REVIEWSPAM = 'ActivitySpamPlugin::REVIEWSPAM';
const TRAINSPAM = 'ActivitySpamPlugin::TRAINSPAM';
common_config('activityspam', 'consumerkey'),
common_config('activityspam', 'secret'));
+ $this->hideSpam = common_config('activityspam', 'hidespam');
+
return true;
}
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;
+ }
}
}
}