Merge pull request #7752 from kPherox/develop
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 18 Oct 2019 10:54:42 +0000 (06:54 -0400)
committerGitHub <noreply@github.com>
Fri, 18 Oct 2019 10:54:42 +0000 (06:54 -0400)
Change Model type to `OrderedCollectionPage`

1  2 
src/Protocol/ActivityPub/Transmitter.php

@@@ -71,6 -71,7 +71,7 @@@ class Transmitte
                if (empty($page)) {
                        $data['first'] = System::baseUrl() . '/followers/' . $owner['nickname'] . '?page=1';
                } else {
+                       $data['type'] = 'OrderedCollectionPage';
                        $list = [];
  
                        $contacts = DBA::select('contact', ['url'], $condition, ['limit' => [($page - 1) * 100, 100]]);
                if (empty($page)) {
                        $data['first'] = System::baseUrl() . '/following/' . $owner['nickname'] . '?page=1';
                } else {
+                       $data['type'] = 'OrderedCollectionPage';
                        $list = [];
  
                        $contacts = DBA::select('contact', ['url'], $condition, ['limit' => [($page - 1) * 100, 100]]);
                if (empty($page)) {
                        $data['first'] = System::baseUrl() . '/outbox/' . $owner['nickname'] . '?page=1';
                } else {
+                       $data['type'] = 'OrderedCollectionPage';
                        $list = [];
  
                        $condition['parent-network'] = Protocol::NATIVE_SUPPORT;
  
                $contacts = DBA::select('contact', ['url', 'network', 'protocol'], $condition);
                while ($contact = DBA::fetch($contacts)) {
 +                      if (Contact::isLocal($contact['url'])) {
 +                              continue;
 +                      }
 +
                        if (!in_array($contact['network'], $networks) && ($contact['protocol'] != Protocol::ACTIVITYPUB)) {
                                continue;
                        }
                                if ($receiver == $item_profile['followers']) {
                                        $inboxes = array_merge($inboxes, self::fetchTargetInboxesforUser($uid, $personal));
                                } else {
 +                                      if (Contact::isLocal($receiver)) {
 +                                              continue;
 +                                      }
 +
                                        $profile = APContact::getByURL($receiver, false);
                                        if (!empty($profile)) {
                                                if (empty($profile['sharedinbox']) || $personal || $blindcopy) {