class GroupNoticeStream extends ScopingNoticeStream
{
var $group;
+ var $userProfile;
function __construct($group, $profile = -1)
{
$profile = Profile::current();
}
$this->group = $group;
+ $this->userProfile = $profile;
parent::__construct(new CachingNoticeStream(new RawGroupNoticeStream($group),
'user_group:notice_ids:' . $group->id),
function impossibleStream()
{
if ($this->group->force_scope &&
- (empty($this->profile) || !$this->profile->isMember($group))) {
+ (empty($this->userProfile) || !$this->userProfile->isMember($group))) {
return true;
}
class ProfileNoticeStream extends ScopingNoticeStream
{
var $streamProfile;
+ var $userProfile;
function __construct($profile, $userProfile = -1)
{
$userProfile = Profile::current();
}
$this->streamProfile = $profile;
+ $this->userProfile = $userProfile;
parent::__construct(new CachingNoticeStream(new RawProfileNoticeStream($profile),
'profile:notice_ids:' . $profile->id),
$userProfile);
// If it's a private stream, and no user or not a subscriber
if (!empty($user) && $user->private_stream &&
- empty($this->profile) || !$this->profile->isSubscribed($this->streamProfile)) {
+ empty($this->userProfile) || !$this->userProfile->isSubscribed($this->streamProfile)) {
return true;
}
if (common_config('notice', 'hidespam')) {
if ($this->streamProfile->hasRole(Profile_role::SILENCED) &&
- (empty($this->profile) || !$this->profile->hasRole(Profile_role::MODERATOR))) {
+ (empty($this->userProfile) || !$this->userProfile->hasRole(Profile_role::MODERATOR))) {
return true;
}
}