3 if (!defined('GNUSOCIAL')) { exit(1); }
5 class NetworkPublicNoticeStream extends ScopingNoticeStream
7 function __construct(Profile $scoped=null)
9 parent::__construct(new CachingNoticeStream(new RawNetworkPublicNoticeStream(),
20 * @author Evan Prodromou <evan@status.net>
21 * @copyright 2011 StatusNet, Inc.
22 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
23 * @link http://status.net/
26 class RawNetworkPublicNoticeStream extends NoticeStream
28 function getNoticeIds($offset, $limit, $since_id, $max_id)
30 $notice = new Notice();
32 $notice->selectAdd(); // clears it
33 $notice->selectAdd('id');
35 $notice->orderBy('created DESC, id DESC');
37 if (!is_null($offset)) {
38 $notice->limit($offset, $limit);
41 $notice->whereAdd('is_local ='. Notice::REMOTE);
42 // -1 == blacklisted, -2 == gateway (i.e. Twitter)
43 $notice->whereAdd('is_local !='. Notice::LOCAL_NONPUBLIC);
44 $notice->whereAdd('is_local !='. Notice::GATEWAY);
46 Notice::addWhereSinceId($notice, $since_id);
47 Notice::addWhereMaxId($notice, $max_id);
49 if (!empty($this->selectVerbs)) {
50 $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb'));
55 if ($notice->find()) {
56 while ($notice->fetch()) {