]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Prefill profile roles when checking scope
authorEvan Prodromou <evan@status.net>
Wed, 21 Mar 2012 17:51:17 +0000 (13:51 -0400)
committerEvan Prodromou <evan@status.net>
Wed, 21 Mar 2012 17:51:28 +0000 (13:51 -0400)
lib/noticelist.php
lib/scopingnoticestream.php

index 5df123fb5f9102303886931f7d0cdfa5e8567cbb..7f38cf005b29469dddca30197946a0cc78da5b4d 100644 (file)
@@ -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));
         }
     }
index 30a7b708d202eb1a62539fc04b36ed4552e553b4..9a101fa3ac03cd314f8e76ec3299ff077d1c354d 100644 (file)
@@ -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));
+        }
     }
 }