X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fpublicnoticestream.php;h=4a16cbd235b789a6465b23ced61ee4feef9b1c1d;hb=46829c6d3c25224b23261ffedc5263326668773a;hp=5c8d313d46591dd3650d80a6bd78352a9aceca48;hpb=d69f912b00ff66e6b315599ce52d6992ac43d19a;p=quix0rs-gnu-social.git diff --git a/lib/publicnoticestream.php b/lib/publicnoticestream.php index 5c8d313d46..4a16cbd235 100644 --- a/lib/publicnoticestream.php +++ b/lib/publicnoticestream.php @@ -28,11 +28,7 @@ * @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 @@ -47,10 +43,11 @@ if (!defined('STATUSNET')) { class PublicNoticeStream extends ScopingNoticeStream { - function __construct() + function __construct($profile=null) { parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream(), - 'public')); + 'public'), + $profile); } } @@ -65,7 +62,7 @@ class PublicNoticeStream extends ScopingNoticeStream * @link http://status.net/ */ -class RawPublicNoticeStream extends NoticeStream +class RawPublicNoticeStream extends FullNoticeStream { function getNoticeIds($offset, $limit, $since_id, $max_id) { @@ -80,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()) { @@ -104,4 +98,4 @@ class RawPublicNoticeStream extends NoticeStream return $ids; } -} \ No newline at end of file +}