3 class PublicNoticeStream extends CachingNoticeStream
7 parent::__construct(new RawPublicNoticeStream(), 'public');
11 class RawPublicNoticeStream extends NoticeStream
13 function getNoticeIds($offset=0, $limit=20, $since_id=0, $max_id=0)
15 $notice = new Notice();
17 $notice->selectAdd(); // clears it
18 $notice->selectAdd('id');
20 $notice->orderBy('created DESC, id DESC');
22 if (!is_null($offset)) {
23 $notice->limit($offset, $limit);
26 if (common_config('public', 'localonly')) {
27 $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
29 // -1 == blacklisted, -2 == gateway (i.e. Twitter)
30 $notice->whereAdd('is_local !='. Notice::LOCAL_NONPUBLIC);
31 $notice->whereAdd('is_local !='. Notice::GATEWAY);
34 Notice::addWhereSinceId($notice, $since_id);
35 Notice::addWhereMaxId($notice, $max_id);
39 if ($notice->find()) {
40 while ($notice->fetch()) {