From 4ea9a0a7e862b50c56616e6c88160dfe152f3a3c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 21 Mar 2012 13:51:17 -0400 Subject: [PATCH] Prefill profile roles when checking scope --- lib/noticelist.php | 14 -------------- lib/scopingnoticestream.php | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/noticelist.php b/lib/noticelist.php index 5df123fb5f..7f38cf005b 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -151,20 +151,6 @@ class NoticeList extends Widget Memcached_DataObject::pivotGet('Notice', 'repeat_of', $ids, array('profile_id' => $p->id)); } - if (common_config('notice', 'hidespam')) { - - $pids = array(); - - foreach ($profiles as $profile) { - $pids[] = $profile->id; - } - - Memcached_DataObject::pivotGet('Profile_role', - 'profile_id', - $pids, - array('role' => Profile_role::SILENCED)); - } - Event::handle('EndNoticeListPrefill', array(&$notices, &$profiles, $avatarSize)); } } diff --git a/lib/scopingnoticestream.php b/lib/scopingnoticestream.php index 30a7b708d2..9a101fa3ac 100644 --- a/lib/scopingnoticestream.php +++ b/lib/scopingnoticestream.php @@ -80,5 +80,19 @@ class ScopingNoticeStream extends FilteringNoticeStream Notice::fillGroups($notices); Notice::fillReplies($notices); + + if (common_config('notice', 'hidespam')) { + + $profiles = Notice::getProfiles($notices); + + foreach ($profiles as $profile) { + $pids[] = $profile->id; + } + + Memcached_DataObject::pivotGet('Profile_role', + 'profile_id', + $pids, + array('role' => Profile_role::SILENCED)); + } } }