* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Public stream
* @link http://status.net/
*/
-class PublicNoticeStream extends ScopingNoticeStream
+class PublicNoticeStream extends ModeratedNoticeStream
{
- const THREADED=true;
-
- /**
- *
- * @param boolean $threaded set to true to exclude replies, for later fetching
- */
- function __construct($threaded=false)
+ function __construct(Profile $scoped=null)
{
- parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream($threaded),
- $threaded ? 'public:threaded' : 'public'));
+ parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream(),
+ 'public'),
+ $scoped);
}
}
* @link http://status.net/
*/
-class RawPublicNoticeStream extends NoticeStream
+class RawPublicNoticeStream extends FullNoticeStream
{
- var $threaded;
-
- function __construct($threaded=false)
- {
- $this->threaded = $threaded;
- }
-
function getNoticeIds($offset, $limit, $since_id, $max_id)
{
$notice = new Notice();
$notice->limit($offset, $limit);
}
- if (common_config('public', 'localonly')) {
- $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
- } else {
- // -1 == blacklisted, -2 == gateway (i.e. Twitter)
- $notice->whereAdd('is_local !='. Notice::LOCAL_NONPUBLIC);
- $notice->whereAdd('is_local !='. Notice::GATEWAY);
- }
- if ($this->threaded) {
- $notice->whereAdd('reply_to IS NULL');
- }
+ // This feed always gives only local activities.
+ $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
Notice::addWhereSinceId($notice, $since_id);
Notice::addWhereMaxId($notice, $max_id);
+ self::filterVerbs($notice, $this->selectVerbs);
+
$ids = array();
if ($notice->find()) {
return $ids;
}
-}
\ No newline at end of file
+}