X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FActivitySpam%2FActivitySpamPlugin.php;h=4d1fa4f6d14aebde0e2719f5474bf830abfac662;hb=546a03b5eac5f172d543a889625e2f4de446e8b7;hp=975fc6885c0c3be709c90c1b9553c8bc98b2c297;hpb=2a4dc77a633cc78907934fd93200ac16d55be78e;p=quix0rs-gnu-social.git diff --git a/plugins/ActivitySpam/ActivitySpamPlugin.php b/plugins/ActivitySpam/ActivitySpamPlugin.php index 975fc6885c..4d1fa4f6d1 100644 --- a/plugins/ActivitySpam/ActivitySpamPlugin.php +++ b/plugins/ActivitySpam/ActivitySpamPlugin.php @@ -92,38 +92,6 @@ class ActivitySpamPlugin extends Plugin return true; } - /** - * Load related modules when needed - * - * @param string $cls Name of the class to be loaded - * - * @return boolean hook value; true means continue processing, false means stop. - */ - - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'TrainAction': - case 'SpamAction': - include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'Spam_score': - include_once $dir . '/'.$cls.'.php'; - return false; - case 'SpamFilter': - case 'SpamNoticeStream': - case 'TrainSpamForm': - case 'TrainHamForm': - include_once $dir . '/'.strtolower($cls).'.php'; - return false; - default: - return true; - } - } - /** * When a notice is saved, check its spam score * @@ -247,10 +215,10 @@ class ActivitySpamPlugin extends Plugin return true; } - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'ActivitySpam', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Evan Prodromou', 'homepage' => 'http://status.net/wiki/Plugin:ActivitySpam', 'description' => @@ -281,12 +249,9 @@ class ActivitySpamPlugin extends Plugin /** * Pre-cache our spam scores if needed. */ - function onEndNoticeListPrefill(&$notices, &$profiles, $avatarSize) { + function onEndNoticeListPrefill(array &$notices, array &$profiles, array $notice_ids, Profile $scoped=null) { if ($this->hideSpam) { - foreach ($notices as $notice) { - $ids[] = $notice->id; - } - Memcached_DataObject::multiGet('Spam_score', 'notice_id', $ids); + Spam_score::multiGet('notice_id', $notice_ids); } return true; }