2014-09-11 02:28:38 +09:00
|
|
|
<?php
|
|
|
|
|
2016-01-18 09:24:37 +09:00
|
|
|
/* · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
|
2014-09-11 02:28:38 +09:00
|
|
|
· ·
|
|
|
|
· ·
|
|
|
|
· Q V I T T E R ·
|
|
|
|
· ·
|
2016-01-18 09:24:37 +09:00
|
|
|
· https://git.gnu.io/h2p/Qvitter ·
|
2014-09-11 02:28:38 +09:00
|
|
|
· ·
|
|
|
|
· ·
|
|
|
|
· <o) ·
|
|
|
|
· /_//// ·
|
|
|
|
· (____/ ·
|
|
|
|
· (o< ·
|
|
|
|
· o> \\\\_\ ·
|
|
|
|
· \\) \____) ·
|
|
|
|
· ·
|
2016-01-18 09:24:37 +09:00
|
|
|
· ·
|
2014-09-11 02:28:38 +09:00
|
|
|
· ·
|
|
|
|
· Qvitter is free software: you can redistribute it and / or modify it ·
|
|
|
|
· under the terms of the GNU Affero General Public License as published by ·
|
|
|
|
· the Free Software Foundation, either version three of the License or (at ·
|
|
|
|
· your option) any later version. ·
|
|
|
|
· ·
|
|
|
|
· Qvitter is distributed in hope that it will be useful but WITHOUT ANY ·
|
|
|
|
· WARRANTY; without even the implied warranty of MERCHANTABILTY or FITNESS ·
|
|
|
|
· FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for ·
|
|
|
|
· more details. ·
|
|
|
|
· ·
|
|
|
|
· You should have received a copy of the GNU Affero General Public License ·
|
|
|
|
· along with Qvitter. If not, see <http://www.gnu.org/licenses/>. ·
|
|
|
|
· ·
|
|
|
|
· Contact h@nnesmannerhe.im if you have any questions. ·
|
2016-01-18 09:24:37 +09:00
|
|
|
· ·
|
2014-09-11 02:28:38 +09:00
|
|
|
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
|
|
|
|
|
|
|
|
|
|
|
|
if (!defined('STATUSNET')) {
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
class PublicAndExternalNoticeStream extends ScopingNoticeStream
|
|
|
|
{
|
|
|
|
function __construct($profile=null)
|
|
|
|
{
|
2016-01-18 09:24:37 +09:00
|
|
|
|
2014-09-11 02:28:38 +09:00
|
|
|
parent::__construct(new CachingNoticeStream(new RawPublicAndExternalNoticeStream(),
|
|
|
|
'publicAndExternal'),
|
|
|
|
$profile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class RawPublicAndExternalNoticeStream extends NoticeStream
|
|
|
|
{
|
|
|
|
function getNoticeIds($offset, $limit, $since_id, $max_id)
|
|
|
|
{
|
|
|
|
|
|
|
|
$notice = new Notice();
|
|
|
|
|
|
|
|
$notice->selectAdd();
|
|
|
|
$notice->selectAdd('id');
|
|
|
|
|
2016-02-04 21:52:16 +09:00
|
|
|
$notice->orderBy('id DESC');
|
2014-09-11 02:28:38 +09:00
|
|
|
|
|
|
|
if (!is_null($offset)) {
|
|
|
|
$notice->limit($offset, $limit);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$notice->whereAdd('is_local !='. Notice::LOCAL_NONPUBLIC);
|
|
|
|
$notice->whereAdd('is_local !='. Notice::GATEWAY);
|
2016-01-18 09:24:37 +09:00
|
|
|
$notice->whereAdd('repeat_of IS NULL');
|
2014-09-11 02:28:38 +09:00
|
|
|
|
|
|
|
Notice::addWhereSinceId($notice, $since_id);
|
|
|
|
Notice::addWhereMaxId($notice, $max_id);
|
|
|
|
|
|
|
|
$ids = array();
|
|
|
|
|
|
|
|
if ($notice->find()) {
|
|
|
|
while ($notice->fetch()) {
|
|
|
|
$ids[] = $notice->id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$notice->free();
|
|
|
|
$notice = NULL;
|
2016-01-18 09:24:37 +09:00
|
|
|
|
2014-09-11 02:28:38 +09:00
|
|
|
return $ids;
|
|
|
|
}
|
2016-01-18 09:24:37 +09:00
|
|
|
}
|