1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class ScopingNoticeStream extends FilteringNoticeStream
- {
- protected $profile;
- function __construct($upstream, $profile = -1)
- {
- parent::__construct($upstream);
-
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
- $this->profile = $profile;
- }
-
- function filter($notice)
- {
- return $notice->inScope($this->profile);
- }
- function prefill($notices)
- {
-
-
- Notice::fillGroups($notices);
- Notice::fillReplies($notices);
- if (common_config('notice', 'hidespam')) {
- $profiles = Notice::getProfiles($notices);
- foreach ($profiles as $profile) {
- $pids[] = $profile->id;
- }
-
- Profile_role::pivotGet('profile_id',
- $pids,
- array('role' => Profile_role::SILENCED));
- }
- }
- }
|