X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fpublicnoticestream.php;h=757c2164c08fc69af8e00bb9a24418d4b13899ec;hb=8b78e01d4c4b9512a7b74efa52fcaf37de0dc6f1;hp=08ac790fabf7889270f0a07b9f47dbd709818d13;hpb=1e73ba00bdd37f46415eb45b1b904dc894fb801c;p=quix0rs-gnu-social.git diff --git a/lib/publicnoticestream.php b/lib/publicnoticestream.php index 08ac790fab..757c2164c0 100644 --- a/lib/publicnoticestream.php +++ b/lib/publicnoticestream.php @@ -47,16 +47,11 @@ if (!defined('STATUSNET')) { class PublicNoticeStream extends ScopingNoticeStream { - const THREADED=true; - - /** - * - * @param boolean $threaded set to true to exclude replies, for later fetching - */ - function __construct($threaded=false) + function __construct($profile=null) { - parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream($threaded), - $threaded ? 'public:threaded' : 'public')); + parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream(), + 'public'), + $profile); } } @@ -73,13 +68,6 @@ class PublicNoticeStream extends ScopingNoticeStream class RawPublicNoticeStream extends NoticeStream { - var $threaded; - - function __construct($threaded=false) - { - $this->threaded = $threaded; - } - function getNoticeIds($offset, $limit, $since_id, $max_id) { $notice = new Notice(); @@ -93,20 +81,16 @@ 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); - } - 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); + if (!empty($this->selectVerbs)) { + $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb')); + } + $ids = array(); if ($notice->find()) { @@ -120,4 +104,4 @@ class RawPublicNoticeStream extends NoticeStream return $ids; } -} \ No newline at end of file +}