* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Class comment
{
protected $profile;
- function __construct($upstream, $profile = -1)
+ function __construct(NoticeStream $upstream, Profile $scoped=null)
{
parent::__construct($upstream);
- // Invalid but not null
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
-
- $this->profile = $profile;
+ $this->profile = $scoped; // legacy
+ $this->scoped = $scoped;
}
/**
* @return boolean whether to include the notice
*/
- function filter($notice)
+ protected function filter(Notice $notice)
{
- return $notice->inScope($this->profile);
+ return $notice->inScope($this->scoped);
}
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));
+ }
}
}