Change Model type to OrderedCollectionPage

Use type `OrderedCollectionPage` instead of `OrderedCollection` in pages or distinct subsets
FYI: https://www.w3.org/TR/activitystreams-core/#h-paging
This commit is contained in:
kPherox 2019-08-29 11:12:01 +09:00
parent d1e1cb2172
commit 0da36b839c
No known key found for this signature in database
GPG key ID: C04751C2BFA2F62D

View file

@ -71,6 +71,7 @@ class Transmitter
if (empty($page)) { if (empty($page)) {
$data['first'] = System::baseUrl() . '/followers/' . $owner['nickname'] . '?page=1'; $data['first'] = System::baseUrl() . '/followers/' . $owner['nickname'] . '?page=1';
} else { } else {
$data['type'] = 'OrderedCollectionPage';
$list = []; $list = [];
$contacts = DBA::select('contact', ['url'], $condition, ['limit' => [($page - 1) * 100, 100]]); $contacts = DBA::select('contact', ['url'], $condition, ['limit' => [($page - 1) * 100, 100]]);
@ -119,6 +120,7 @@ class Transmitter
if (empty($page)) { if (empty($page)) {
$data['first'] = System::baseUrl() . '/following/' . $owner['nickname'] . '?page=1'; $data['first'] = System::baseUrl() . '/following/' . $owner['nickname'] . '?page=1';
} else { } else {
$data['type'] = 'OrderedCollectionPage';
$list = []; $list = [];
$contacts = DBA::select('contact', ['url'], $condition, ['limit' => [($page - 1) * 100, 100]]); $contacts = DBA::select('contact', ['url'], $condition, ['limit' => [($page - 1) * 100, 100]]);
@ -165,6 +167,7 @@ class Transmitter
if (empty($page)) { if (empty($page)) {
$data['first'] = System::baseUrl() . '/outbox/' . $owner['nickname'] . '?page=1'; $data['first'] = System::baseUrl() . '/outbox/' . $owner['nickname'] . '?page=1';
} else { } else {
$data['type'] = 'OrderedCollectionPage';
$list = []; $list = [];
$condition['parent-network'] = Protocol::NATIVE_SUPPORT; $condition['parent-network'] = Protocol::NATIVE_SUPPORT;