X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpublicnoticestream.php;h=4a16cbd235b789a6465b23ced61ee4feef9b1c1d;hb=46829c6d3c25224b23261ffedc5263326668773a;hp=0162375451e73205b50aafa4d4177f10ccc37510;hpb=22bf63bb469327f77708d734d7277274ed4735ef;p=quix0rs-gnu-social.git diff --git a/lib/publicnoticestream.php b/lib/publicnoticestream.php index 0162375451..4a16cbd235 100644 --- a/lib/publicnoticestream.php +++ b/lib/publicnoticestream.php @@ -1,16 +1,70 @@ . + * + * @category Stream + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ -class PublicNoticeStream extends CachingNoticeStream +if (!defined('GNUSOCIAL')) { exit(1); } + +/** + * Public stream + * + * @category Stream + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +class PublicNoticeStream extends ScopingNoticeStream { - function __construct() + function __construct($profile=null) { - parent::__construct(new RawPublicNoticeStream(), 'public'); + parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream(), + 'public'), + $profile); } } -class RawPublicNoticeStream extends NoticeStream +/** + * Raw public stream + * + * @category Stream + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +class RawPublicNoticeStream extends FullNoticeStream { - function getNoticeIds($offset=0, $limit=20, $since_id=0, $max_id=0) + function getNoticeIds($offset, $limit, $since_id, $max_id) { $notice = new Notice(); @@ -23,17 +77,14 @@ class RawPublicNoticeStream extends NoticeStream $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); - } + // 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()) { @@ -47,4 +98,4 @@ class RawPublicNoticeStream extends NoticeStream return $ids; } -} \ No newline at end of file +}