*/
class ConversationNoticeStream extends ScopingNoticeStream
{
- function __construct($id, $profile = null)
+ function __construct($id, $profile = -1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
+
parent::__construct(new CachingNoticeStream(new RawConversationNoticeStream($id),
'notice:conversation_ids:'.$id),
$profile);
*/
class FaveNoticeStream extends ScopingNoticeStream
{
- function __construct($user_id, $own)
+ function __construct($user_id, $own, $profile = -1)
{
$stream = new RawFaveNoticeStream($user_id, $own);
if ($own) {
} else {
$key = 'fave:ids_by_user:'.$user_id;
}
- parent::__construct(new CachingNoticeStream($stream, $key));
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
+ parent::__construct(new CachingNoticeStream($stream, $key),
+ $profile);
}
}
class FileNoticeStream extends ScopingNoticeStream
{
- function __construct($file)
+ function __construct($file, $profile = -1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawFileNoticeStream($file),
- 'file:notice-ids:'.$this->url));
+ 'file:notice-ids:'.$this->url),
+ $profile);
}
}
*/
class GroupNoticeStream extends ScopingNoticeStream
{
- function __construct($group, $profile = null)
+ function __construct($group, $profile = -1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawGroupNoticeStream($group),
'user_group:notice_ids:' . $group->id),
$profile);
*
* @param User $user User to get a stream for
*/
- function __construct($user, $profile = null)
+ function __construct($user, $profile = -1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
// Note: we don't use CachingNoticeStream since RawInboxNoticeStream
// uses Inbox::staticGet(), which is cached.
parent::__construct(new RawInboxNoticeStream($user), $profile);
*/
class PeopletagNoticeStream extends ScopingNoticeStream
{
- function __construct($plist)
+ function __construct($plist, $profile = -1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawPeopletagNoticeStream($plist),
- 'profile_tag:notice_ids:' . $plist->id));
+ 'profile_tag:notice_ids:' . $plist->id),
+ $profile);
}
}
class ProfileNoticeStream extends ScopingNoticeStream
{
- function __construct($profile)
+ function __construct($profile, $userProfile = -1)
{
+ if (is_int($userProfile) && $userProfile == -1) {
+ $userProfile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawProfileNoticeStream($profile),
- 'profile:notice_ids:' . $profile->id));
+ 'profile:notice_ids:' . $profile->id),
+ $userProfile);
}
}
class RepeatedByMeNoticeStream extends ScopingNoticeStream
{
- function __construct($user)
+ function __construct($user, $profile = -1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawRepeatedByMeNoticeStream($user),
- 'user:repeated_by_me:'.$user->id));
+ 'user:repeated_by_me:'.$user->id),
+ $profile);
}
}
class RepeatsOfMeNoticeStream extends ScopingNoticeStream
{
- function __construct($user)
+ function __construct($user, $profile=-1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawRepeatsOfMeNoticeStream($user),
- 'user:repeats_of_me:'.$user->id));
+ 'user:repeats_of_me:'.$user->id),
+ $profile);
}
}
class ReplyNoticeStream extends ScopingNoticeStream
{
- function __construct($userId)
+ function __construct($userId, $profile=-1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawReplyNoticeStream($userId),
- 'reply:stream:' . $userId));
+ 'reply:stream:' . $userId),
+ $profile);
}
}
class TaggedProfileNoticeStream extends ScopingNoticeStream
{
- function __construct($profile, $tag)
+ function __construct($profile, $tag, $userProfile)
{
+ if (is_int($userProfile) && $userProfile == -1) {
+ $userProfile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawTaggedProfileNoticeStream($profile, $tag),
- 'profile:notice_ids_tagged:'.$profile->id.':'.Cache::keyize($tag)));
+ 'profile:notice_ids_tagged:'.$profile->id.':'.Cache::keyize($tag)),
+ $userProfile);
}
}
class TagNoticeStream extends ScopingNoticeStream
{
- function __construct($tag)
+ function __construct($tag, $profile = -1)
{
+ if (is_int($profile) && $profile == -1) {
+ $profile = Profile::current();
+ }
parent::__construct(new CachingNoticeStream(new RawTagNoticeStream($tag),
'notice_tag:notice_ids:' . Cache::keyize($tag)));
}