X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fnoticesearchrss.php;h=2e3a0548e5be7aca5f7c1b13ba03ed55d9a677cd;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=b12ea8de9cab4ffeac8aa94431fa451254ce128f;hpb=abd90bbdf562614755802885dfb5673645df8575;p=quix0rs-gnu-social.git diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php index b12ea8de9c..2e3a0548e5 100644 --- a/actions/noticesearchrss.php +++ b/actions/noticesearchrss.php @@ -28,11 +28,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR.'/lib/rssaction.php'; +if (!defined('GNUSOCIAL')) { exit(1); } /** * RSS feed for notice search action class. @@ -48,19 +44,7 @@ require_once INSTALLDIR.'/lib/rssaction.php'; */ class NoticesearchrssAction extends Rss10Action { - function init() - { - return true; - } - - function prepare(array $args=array()) - { - parent::prepare($args); - $this->notices = $this->getNotices(); - return true; - } - - function getNotices($limit=0) + protected function getNotices() { $q = $this->trimmed('q'); $notices = array(); @@ -70,8 +54,7 @@ class NoticesearchrssAction extends Rss10Action $search_engine = $notice->getSearchEngine('notice'); $search_engine->set_sort_mode('chron'); - if (!$limit) $limit = 20; - $search_engine->limit(0, $limit, true); + $search_engine->limit(0, $this->limit, true); if (false === $search_engine->query($q)) { $cnt = 0; } else { @@ -80,7 +63,11 @@ class NoticesearchrssAction extends Rss10Action if ($cnt > 0) { while ($notice->fetch()) { - $notices[] = clone($notice); + // Check scope of notice to current profile (including guests) + if ($notice->isCurrentProfileInScope()) { + // Is in scope + $notices[] = clone($notice); + } } }