return true;
}
- function onNoticeDeleteRelated($notice) {
+ function onNoticeDeleteRelated(Notice $notice) {
$score = Spam_score::getKV('notice_id', $notice->id);
if (!empty($score)) {
$score->delete();
return true;
}
- function onUserRightsCheck($profile, $right, &$result) {
+ function onUserRightsCheck(Profile $profile, $right, &$result) {
switch ($right) {
case self::REVIEWSPAM:
case self::TRAINSPAM:
/**
* Map URLs to actions
*
- * @param Net_URL_Mapper $m path-to-action mapper
+ * @param URLMapper $m path-to-action mapper
*
* @return boolean hook value; true means continue processing, false means stop.
*/
- function onRouterInitialized($m)
+ public function onRouterInitialized(URLMapper $m)
{
$m->connect('main/train/spam',
array('action' => 'train', 'category' => 'spam'));
return true;
}
- function onEndShowStyles($action)
+ function onEndShowStyles(Action $action)
{
$action->element('style', null,
'.form-train-spam input.submit { background: url('.$this->path('icons/bullet_black.png').') no-repeat 0px 0px } ' . "\n" .
return true;
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'ActivitySpam',
'version' => GNUSOCIAL_VERSION,
/**
* 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;
- }
- Spam_score::multiGet('notice_id', $ids);
+ Spam_score::multiGet('notice_id', $notice_ids);
}
return true;
}