]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'upstream/develop' into api4
authorMichael <heluecht@pirati.ca>
Thu, 18 Nov 2021 20:15:57 +0000 (20:15 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 18 Nov 2021 20:15:57 +0000 (20:15 +0000)
1  2 
src/Module/Api/Friendica/Profile/Show.php
src/Module/Api/Twitter/Followers/Ids.php
src/Module/Api/Twitter/Followers/Lists.php
src/Module/Api/Twitter/Friends/Ids.php
src/Module/Api/Twitter/Friends/Lists.php
src/Module/BaseApi.php

index 6412b0eaa2aca9a5d15d822e4f1b9a75f01a58a1,0000000000000000000000000000000000000000..cab4c386471a74c1ce4285c362be24c19c58fd0b
mode 100644,000000..100644
--- /dev/null
@@@ -1,61 -1,0 +1,61 @@@
-       public static function rawContent(array $parameters = [])
 +<?php
 +/**
 + * @copyright Copyright (C) 2010-2021, the Friendica project
 + *
 + * @license GNU AGPL version 3 or any later version
 + *
 + * This program 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 3 of the
 + * License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY 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 this program.  If not, see <https://www.gnu.org/licenses/>.
 + *
 + */
 +
 +namespace Friendica\Module\Api\Twitter\Followers;
 +
 +use Friendica\Core\System;
 +use Friendica\Model\Contact;
 +use Friendica\Module\Api\Twitter\ContactEndpoint;
 +
 +/**
 + * @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids
 + */
 +class FollowersIds extends ContactEndpoint
 +{
++      public function rawContent()
 +      {
 +              // Expected value for user_id parameter: public/user contact id
 +              $contact_id    = filter_input(INPUT_GET, 'user_id'      , FILTER_VALIDATE_INT);
 +              $screen_name   = filter_input(INPUT_GET, 'screen_name');
 +              $cursor        = filter_input(INPUT_GET, 'cursor'       , FILTER_VALIDATE_INT);
 +              $stringify_ids = filter_input(INPUT_GET, 'stringify_ids', FILTER_VALIDATE_BOOLEAN);
 +              $count         = filter_input(INPUT_GET, 'count'        , FILTER_VALIDATE_INT, ['options' => [
 +                      'default' => self::DEFAULT_COUNT,
 +                      'min_range' => 1,
 +                      'max_range' => self::MAX_COUNT,
 +              ]]);
 +              // Friendica-specific
 +              $since_id      = filter_input(INPUT_GET, 'since_id'     , FILTER_VALIDATE_INT);
 +              $max_id        = filter_input(INPUT_GET, 'max_id'       , FILTER_VALIDATE_INT, ['options' => [
 +                      'default' => 1,
 +              ]]);
 +
 +              // @todo Use Model\Contact\Relation::listFollowers($cid, $condition, $count);
 +
 +              System::jsonExit(self::ids(
 +                      [Contact::FOLLOWER, Contact::FRIEND],
 +                      self::getUid($contact_id, $screen_name),
 +                      $cursor ?? $since_id ?? - $max_id,
 +                      $count,
 +                      $stringify_ids
 +              ));
 +      }
 +}
index 58b2226a517a05c65c6d5731d2588c4843315464,0000000000000000000000000000000000000000..41d44d6280d5734edb84bc64f785dec65bb3b43c
mode 100644,000000..100644
--- /dev/null
@@@ -1,64 -1,0 +1,64 @@@
-       public static function rawContent(array $parameters = [])
 +<?php
 +/**
 + * @copyright Copyright (C) 2010-2021, the Friendica project
 + *
 + * @license GNU AGPL version 3 or any later version
 + *
 + * This program 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 3 of the
 + * License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY 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 this program.  If not, see <https://www.gnu.org/licenses/>.
 + *
 + */
 +
 +namespace Friendica\Module\Api\Twitter\Followers;
 +
 +use Friendica\Core\System;
 +use Friendica\Model\Contact;
 +use Friendica\Module\Api\Twitter\ContactEndpoint;
 +
 +/**
 + * @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-list
 + */
 +class FollowersList extends ContactEndpoint
 +{
++      public function rawContent()
 +      {
 +              // Expected value for user_id parameter: public/user contact id
 +              $contact_id    = filter_input(INPUT_GET, 'user_id'      , FILTER_VALIDATE_INT);
 +              $screen_name   = filter_input(INPUT_GET, 'screen_name');
 +              $cursor        = filter_input(INPUT_GET, 'cursor'       , FILTER_VALIDATE_INT);
 +              $count         = filter_input(INPUT_GET, 'count'        , FILTER_VALIDATE_INT, ['options' => [
 +                      'default' => self::DEFAULT_COUNT,
 +                      'min_range' => 1,
 +                      'max_range' => self::MAX_COUNT,
 +              ]]);
 +              $skip_status           = filter_input(INPUT_GET, 'skip_status'          , FILTER_VALIDATE_BOOLEAN);
 +              $include_user_entities = filter_input(INPUT_GET, 'include_user_entities', FILTER_VALIDATE_BOOLEAN);
 +
 +              // Friendica-specific
 +              $since_id      = filter_input(INPUT_GET, 'since_id'     , FILTER_VALIDATE_INT);
 +              $max_id        = filter_input(INPUT_GET, 'max_id'       , FILTER_VALIDATE_INT, ['options' => [
 +                      'default' => 1,
 +              ]]);
 +
 +              // @todo Use Model\Contact\Relation::listFollowers($cid, $condition, $count);
 +
 +              System::jsonExit(self::list(
 +                      [Contact::FOLLOWER, Contact::FRIEND],
 +                      self::getUid($contact_id, $screen_name),
 +                      $cursor ?? $since_id ?? - $max_id,
 +                      $count,
 +                      $skip_status,
 +                      $include_user_entities
 +              ));
 +      }
 +}
index 6f11776725924ed603d174ed7275a1bff94c8721,0000000000000000000000000000000000000000..9c58ac652a04120d89624412e5a5041447673b41
mode 100644,000000..100644
--- /dev/null
@@@ -1,61 -1,0 +1,61 @@@
-       public static function rawContent(array $parameters = [])
 +<?php
 +/**
 + * @copyright Copyright (C) 2010-2021, the Friendica project
 + *
 + * @license GNU AGPL version 3 or any later version
 + *
 + * This program 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 3 of the
 + * License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY 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 this program.  If not, see <https://www.gnu.org/licenses/>.
 + *
 + */
 +
 +namespace Friendica\Module\Api\Twitter\Friends;
 +
 +use Friendica\Core\System;
 +use Friendica\Model\Contact;
 +use Friendica\Module\Api\Twitter\ContactEndpoint;
 +
 +/**
 + * @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids
 + */
 +class Ids extends ContactEndpoint
 +{
++      public function rawContent()
 +      {
 +              // Expected value for user_id parameter: public/user contact id
 +              $contact_id    = filter_input(INPUT_GET, 'user_id'      , FILTER_VALIDATE_INT);
 +              $screen_name   = filter_input(INPUT_GET, 'screen_name');
 +              $cursor        = filter_input(INPUT_GET, 'cursor'       , FILTER_VALIDATE_INT);
 +              $stringify_ids = filter_input(INPUT_GET, 'stringify_ids', FILTER_VALIDATE_BOOLEAN);
 +              $count         = filter_input(INPUT_GET, 'count'        , FILTER_VALIDATE_INT, ['options' => [
 +                      'default' => self::DEFAULT_COUNT,
 +                      'min_range' => 1,
 +                      'max_range' => self::MAX_COUNT,
 +              ]]);
 +              // Friendica-specific
 +              $since_id      = filter_input(INPUT_GET, 'since_id'     , FILTER_VALIDATE_INT);
 +              $max_id        = filter_input(INPUT_GET, 'max_id'       , FILTER_VALIDATE_INT, ['options' => [
 +                      'default' => 1,
 +              ]]);
 +
 +              // @todo Use Model\Contact\Relation::listFollows($cid, $condition, $count);
 +
 +              System::jsonExit(self::ids(
 +                      [Contact::SHARING, Contact::FRIEND],
 +                      self::getUid($contact_id, $screen_name),
 +                      $cursor ?? $since_id ?? - $max_id,
 +                      $count,
 +                      $stringify_ids
 +              ));
 +      }
 +}
index 9fa1b9d22c89bae51da67ed2b26c218cc3a3a945,0000000000000000000000000000000000000000..144350214c472d5485f6a3953ee75a3b0b3c1ab3
mode 100644,000000..100644
--- /dev/null
@@@ -1,64 -1,0 +1,64 @@@
-       public static function rawContent(array $parameters = [])
 +<?php
 +/**
 + * @copyright Copyright (C) 2010-2021, the Friendica project
 + *
 + * @license GNU AGPL version 3 or any later version
 + *
 + * This program 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 3 of the
 + * License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY 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 this program.  If not, see <https://www.gnu.org/licenses/>.
 + *
 + */
 +
 +namespace Friendica\Module\Api\Twitter\Friends;
 +
 +use Friendica\Core\System;
 +use Friendica\Model\Contact;
 +use Friendica\Module\Api\Twitter\ContactEndpoint;
 +
 +/**
 + * @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friends-list
 + */
 +class Lists extends ContactEndpoint
 +{
++      public function rawContent()
 +      {
 +              // Expected value for user_id parameter: public/user contact id
 +              $contact_id    = filter_input(INPUT_GET, 'user_id'      , FILTER_VALIDATE_INT);
 +              $screen_name   = filter_input(INPUT_GET, 'screen_name');
 +              $cursor        = filter_input(INPUT_GET, 'cursor'       , FILTER_VALIDATE_INT);
 +              $count         = filter_input(INPUT_GET, 'count'        , FILTER_VALIDATE_INT, ['options' => [
 +                      'default' => self::DEFAULT_COUNT,
 +                      'min_range' => 1,
 +                      'max_range' => self::MAX_COUNT,
 +              ]]);
 +              $skip_status           = filter_input(INPUT_GET, 'skip_status'          , FILTER_VALIDATE_BOOLEAN);
 +              $include_user_entities = filter_input(INPUT_GET, 'include_user_entities', FILTER_VALIDATE_BOOLEAN);
 +
 +              // Friendica-specific
 +              $since_id      = filter_input(INPUT_GET, 'since_id'     , FILTER_VALIDATE_INT);
 +              $max_id        = filter_input(INPUT_GET, 'max_id'       , FILTER_VALIDATE_INT, ['options' => [
 +                      'default' => 1,
 +              ]]);
 +
 +              // @todo Use Model\Contact\Relation::listFollows($cid, $condition, $count);
 +
 +              System::jsonExit(self::list(
 +                      [Contact::SHARING, Contact::FRIEND],
 +                      self::getUid($contact_id, $screen_name),
 +                      $cursor ?? $since_id ?? - $max_id,
 +                      $count,
 +                      $skip_status,
 +                      $include_user_entities
 +              ));
 +      }
 +}
Simple merge