3 class RepeatsOfMeNoticeStream extends CachingNoticeStream
5 function __construct($user)
7 parent::__construct(new RawRepeatsOfMeNoticeStream($user),
8 'user:repeats_of_me:'.$user->id);
12 class RawRepeatsOfMeNoticeStream extends NoticeStream
16 function __construct($user)
21 function getNoticeIds($offset, $limit, $since_id, $max_id)
24 'SELECT DISTINCT original.id AS id ' .
25 'FROM notice original JOIN notice rept ON original.id = rept.repeat_of ' .
26 'WHERE original.profile_id = ' . $this->user->id . ' ';
28 $since = Notice::whereSinceId($since_id, 'original.id', 'original.created');
30 $qry .= "AND ($since) ";
33 $max = Notice::whereMaxId($max_id, 'original.id', 'original.created');
35 $qry .= "AND ($max) ";
38 $qry .= 'ORDER BY original.created, original.id DESC ';
40 if (!is_null($offset)) {
41 $qry .= "LIMIT $limit OFFSET $offset";
46 $notice = new Notice();
50 while ($notice->fetch()) {