1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- defined('GNUSOCIAL') || die();
- class NetworkPublicNoticeStream extends ModeratedNoticeStream
- {
- public function __construct(Profile $scoped = null)
- {
- parent::__construct(
- new CachingNoticeStream(
- new RawNetworkPublicNoticeStream(),
- 'networkpublic'
- ),
- $scoped
- );
- }
- }
- class RawNetworkPublicNoticeStream extends FullNoticeStream
- {
- public function getNoticeIds($offset, $limit, $since_id, $max_id)
- {
- $notice = new Notice();
- $notice->selectAdd();
- $notice->selectAdd('id');
- $notice->orderBy('created DESC, id DESC');
- if (!is_null($offset)) {
- $notice->limit($offset, $limit);
- }
- $notice->whereAdd('is_local = '. Notice::REMOTE);
-
- $notice->whereAdd('is_local <> '. Notice::LOCAL_NONPUBLIC);
- $notice->whereAdd('is_local <> '. Notice::GATEWAY);
- $notice->whereAdd('scope <> ' . Notice::MESSAGE_SCOPE);
- Notice::addWhereSinceId($notice, $since_id);
- Notice::addWhereMaxId($notice, $max_id);
- self::filterVerbs($notice, $this->selectVerbs);
- $ids = array();
- if ($notice->find()) {
- while ($notice->fetch()) {
- $ids[] = $notice->id;
- }
- }
- $notice->free();
- $notice = null;
- return $ids;
- }
- }
|