]> git.mxchange.org Git - friendica.git/commitdiff
Switch `static::$parameters` to `$this->parameters`
authorPhilipp <admin@philipp.info>
Sun, 14 Nov 2021 22:19:25 +0000 (23:19 +0100)
committerPhilipp <admin@philipp.info>
Sun, 14 Nov 2021 22:49:07 +0000 (23:49 +0100)
116 files changed:
src/App/Module.php
src/BaseModule.php
src/LegacyModule.php
src/Module/ActivityPub/Followers.php
src/Module/ActivityPub/Following.php
src/Module/ActivityPub/Inbox.php
src/Module/ActivityPub/Objects.php
src/Module/ActivityPub/Outbox.php
src/Module/Admin/Addons/Details.php
src/Module/Admin/DBSync.php
src/Module/Admin/Item/Source.php
src/Module/Admin/Queue.php
src/Module/Admin/Storage.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Tos.php
src/Module/Admin/Users/Active.php
src/Module/Admin/Users/Blocked.php
src/Module/Admin/Users/Index.php
src/Module/Admin/Users/Pending.php
src/Module/Api/Friendica/Activity.php
src/Module/Api/Friendica/DirectMessages/Setseen.php
src/Module/Api/Friendica/Events/Index.php
src/Module/Api/Friendica/Notification.php
src/Module/Api/Friendica/Photo/Delete.php
src/Module/Api/Friendica/Photoalbum/Delete.php
src/Module/Api/Friendica/Photoalbum/Update.php
src/Module/Api/Friendica/Profile/Show.php
src/Module/Api/GNUSocial/GNUSocial/Version.php
src/Module/Api/GNUSocial/Help/Test.php
src/Module/Api/Mastodon/Accounts.php
src/Module/Api/Mastodon/Accounts/Block.php
src/Module/Api/Mastodon/Accounts/Follow.php
src/Module/Api/Mastodon/Accounts/Followers.php
src/Module/Api/Mastodon/Accounts/Following.php
src/Module/Api/Mastodon/Accounts/Lists.php
src/Module/Api/Mastodon/Accounts/Mute.php
src/Module/Api/Mastodon/Accounts/Note.php
src/Module/Api/Mastodon/Accounts/Statuses.php
src/Module/Api/Mastodon/Accounts/Unblock.php
src/Module/Api/Mastodon/Accounts/Unfollow.php
src/Module/Api/Mastodon/Accounts/Unmute.php
src/Module/Api/Mastodon/Blocks.php
src/Module/Api/Mastodon/Conversations.php
src/Module/Api/Mastodon/Conversations/Read.php
src/Module/Api/Mastodon/FollowRequests.php
src/Module/Api/Mastodon/Lists.php
src/Module/Api/Mastodon/Lists/Accounts.php
src/Module/Api/Mastodon/Media.php
src/Module/Api/Mastodon/Mutes.php
src/Module/Api/Mastodon/Notifications.php
src/Module/Api/Mastodon/Notifications/Dismiss.php
src/Module/Api/Mastodon/ScheduledStatuses.php
src/Module/Api/Mastodon/Search.php
src/Module/Api/Mastodon/Statuses.php
src/Module/Api/Mastodon/Statuses/Bookmark.php
src/Module/Api/Mastodon/Statuses/Card.php
src/Module/Api/Mastodon/Statuses/Context.php
src/Module/Api/Mastodon/Statuses/Favourite.php
src/Module/Api/Mastodon/Statuses/FavouritedBy.php
src/Module/Api/Mastodon/Statuses/Mute.php
src/Module/Api/Mastodon/Statuses/Pin.php
src/Module/Api/Mastodon/Statuses/Reblog.php
src/Module/Api/Mastodon/Statuses/RebloggedBy.php
src/Module/Api/Mastodon/Statuses/Unbookmark.php
src/Module/Api/Mastodon/Statuses/Unfavourite.php
src/Module/Api/Mastodon/Statuses/Unmute.php
src/Module/Api/Mastodon/Statuses/Unpin.php
src/Module/Api/Mastodon/Statuses/Unreblog.php
src/Module/Api/Mastodon/Timelines/ListTimeline.php
src/Module/Api/Mastodon/Timelines/Tag.php
src/Module/Api/Twitter/Account/RateLimitStatus.php
src/Module/Api/Twitter/SavedSearches.php
src/Module/Attach.php
src/Module/Contact/Advanced.php
src/Module/Contact/Contacts.php
src/Module/Contact/Media.php
src/Module/Contact/Poke.php
src/Module/Contact/Revoke.php
src/Module/Conversation/Community.php
src/Module/Conversation/Network.php
src/Module/DFRN/Notify.php
src/Module/DFRN/Poll.php
src/Module/Debug/ItemBody.php
src/Module/Diaspora/Fetch.php
src/Module/Diaspora/Receive.php
src/Module/Feed.php
src/Module/Filer/RemoveTag.php
src/Module/Filer/SaveTag.php
src/Module/FriendSuggest.php
src/Module/HCard.php
src/Module/Item/Activity.php
src/Module/Item/Compose.php
src/Module/Item/Follow.php
src/Module/Item/Ignore.php
src/Module/Item/Pin.php
src/Module/Item/Star.php
src/Module/NoScrape.php
src/Module/Notifications/Notification.php
src/Module/PermissionTooltip.php
src/Module/Photo.php
src/Module/Profile/Common.php
src/Module/Profile/Contacts.php
src/Module/Profile/Index.php
src/Module/Profile/Media.php
src/Module/Profile/Profile.php
src/Module/Profile/Schedule.php
src/Module/Profile/Status.php
src/Module/Proxy.php
src/Module/PublicRSAKey.php
src/Module/Register.php
src/Module/RemoteFollow.php
src/Module/Settings/Profile/Photo/Crop.php
src/Module/Theme.php
src/Module/Update/Community.php
src/Module/Update/Network.php

index 0ed4b53e5740051a2441a90c1c4c1af2d8dafa47..eb1621b8b37a296b3a7e8bda1a9b59fea5f4e1cf 100644 (file)
@@ -182,7 +182,7 @@ class Module
                 **/
                try {
                        $module_class = $router->getModuleClass($args->getCommand());
-                       $module_parameters = $router->getModuleParameters();
+                       $module_parameters[] = $router->getModuleParameters();
                } catch (MethodNotAllowedException $e) {
                        $module_class = MethodNotAllowed::class;
                } catch (NotFoundException $e) {
@@ -195,8 +195,8 @@ class Module
                                } else {
                                        include_once "addon/{$this->module}/{$this->module}.php";
                                        if (function_exists($this->module . '_module')) {
-                                               LegacyModule::setModuleFile("addon/{$this->module}/{$this->module}.php");
-                                               $module_class = LegacyModule::class;
+                                               $module_parameters[] = "addon/{$this->module}/{$this->module}.php";
+                                               $module_class        = LegacyModule::class;
                                        }
                                }
                        }
@@ -205,15 +205,15 @@ class Module
                         * We emulate a Module class through the LegacyModule class
                         */
                        if (!$module_class && file_exists("mod/{$this->module}.php")) {
-                               LegacyModule::setModuleFile("mod/{$this->module}.php");
-                               $module_class = LegacyModule::class;
+                               $module_parameters[] = "mod/{$this->module}.php";
+                               $module_class        = LegacyModule::class;
                        }
 
                        $module_class = $module_class ?: PageNotFound::class;
                }
 
                /** @var ICanHandleRequests $module */
-               $module = $dice->create($module_class, [$module_parameters]);
+               $module = $dice->create($module_class, $module_parameters);
 
                return new Module($this->module, $module, $this->isBackend, $printNotAllowedAddon);
        }
index 76458c6c681d3c4880894d465ef78ff18c0d4501..2873357fd85425dea6c6d6d48ab790765bd576b1 100644 (file)
@@ -37,11 +37,11 @@ use Friendica\Model\User;
 abstract class BaseModule implements ICanHandleRequests
 {
        /** @var array */
-       protected static $parameters = [];
+       protected $parameters = [];
 
        public function __construct(array $parameters = [])
        {
-               static::$parameters = $parameters;
+               $this->parameters = $parameters;
        }
 
        /**
index e90b004bc4ffd1ff9070774bd1eee3fddc75024d..5f0cc3103cc4f0a7f02ec5ed04ba40b237a52801 100644 (file)
@@ -35,7 +35,14 @@ class LegacyModule extends BaseModule
         *
         * @var string
         */
-       private static $moduleName = '';
+       private $moduleName = '';
+
+       public function __construct(string $file_path = '', array $parameters = [])
+       {
+               parent::__construct($parameters);
+
+               $this->setModuleFile($file_path);
+       }
 
        /**
         * The only method that needs to be called, with the module/addon file name.
@@ -43,35 +50,35 @@ class LegacyModule extends BaseModule
         * @param string $file_path
         * @throws \Exception
         */
-       public static function setModuleFile($file_path)
+       private function setModuleFile($file_path)
        {
                if (!is_readable($file_path)) {
                        throw new \Exception(DI::l10n()->t('Legacy module file not found: %s', $file_path));
                }
 
-               self::$moduleName = basename($file_path, '.php');
+               $this->moduleName = basename($file_path, '.php');
 
                require_once $file_path;
        }
 
        public function init()
        {
-               self::runModuleFunction('init', static::$parameters);
+               $this->runModuleFunction('init');
        }
 
        public function content(): string
        {
-               return self::runModuleFunction('content', static::$parameters);
+               return $this->runModuleFunction('content');
        }
 
        public function post()
        {
-               self::runModuleFunction('post', static::$parameters);
+               $this->runModuleFunction('post');
        }
 
        public function afterpost()
        {
-               self::runModuleFunction('afterpost', static::$parameters);
+               $this->runModuleFunction('afterpost');
        }
 
        /**
@@ -81,15 +88,15 @@ class LegacyModule extends BaseModule
         * @return string
         * @throws \Exception
         */
-       private static function runModuleFunction($function_suffix, array $parameters = [])
+       private function runModuleFunction(string $function_suffix)
        {
-               $function_name = static::$moduleName . '_' . $function_suffix;
+               $function_name = $this->moduleName . '_' . $function_suffix;
 
                if (\function_exists($function_name)) {
                        $a = DI::app();
                        return $function_name($a);
                } else {
-                       return parent::{$function_suffix}($parameters);
+                       return parent::{$function_suffix}($this->parameters);
                }
        }
 }
index e19e7eacfd533b1f2d541e54c1da81d284a73a8e..d25e4693c9fd1c39d36be623d30a09b5bb3dceb7 100644 (file)
@@ -33,12 +33,12 @@ class Followers extends BaseModule
 {
        public function rawContent()
        {
-               if (empty(static::$parameters['nickname'])) {
+               if (empty($this->parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
                // @TODO: Replace with parameter from router
-               $owner = User::getOwnerDataByNick(static::$parameters['nickname']);
+               $owner = User::getOwnerDataByNick($this->parameters['nickname']);
                if (empty($owner)) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
index 2fa2d640f732f88405f3e10c4aeac64722536776..3b45cf09a608f87514f27bb7e8e5cfcf7ef00cbf 100644 (file)
@@ -33,11 +33,11 @@ class Following extends BaseModule
 {
        public function rawContent()
        {
-               if (empty(static::$parameters['nickname'])) {
+               if (empty($this->parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
-               $owner = User::getOwnerDataByNick(static::$parameters['nickname']);
+               $owner = User::getOwnerDataByNick($this->parameters['nickname']);
                if (empty($owner)) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
index 4056a7de3be11f4181acbdf197e4edc9a5fa84ef..149e51106959e24526f0f0bdb37e5db50de09982 100644 (file)
@@ -50,12 +50,12 @@ class Inbox extends BaseModule
                                $filename = 'failed-activitypub';
                        }
                        $tempfile = tempnam(System::getTempPath(), $filename);
-                       file_put_contents($tempfile, json_encode(['parameters' => static::$parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
+                       file_put_contents($tempfile, json_encode(['parameters' => $this->parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
                        Logger::notice('Incoming message stored', ['file' => $tempfile]);
                }
 
-               if (!empty(static::$parameters['nickname'])) {
-                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]);
+               if (!empty($this->parameters['nickname'])) {
+                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname']]);
                        if (!DBA::isResult($user)) {
                                throw new \Friendica\Network\HTTPException\NotFoundException();
                        }
index eedcb0bd44252ddffb144e7adfb6d246fc9d790c..5798c5685da7b93940d999218c06f847e016c612 100644 (file)
@@ -43,7 +43,7 @@ class Objects extends BaseModule
 {
        public function rawContent()
        {
-               if (empty(static::$parameters['guid'])) {
+               if (empty($this->parameters['guid'])) {
                        throw new HTTPException\BadRequestException();
                }
 
@@ -51,10 +51,10 @@ class Objects extends BaseModule
                        DI::baseUrl()->redirect(str_replace('objects/', 'display/', DI::args()->getQueryString()));
                }
 
-               $itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => static::$parameters['guid']]);
+               $itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => $this->parameters['guid']]);
 
                if (DBA::isResult($itemuri)) {
-                       Logger::info('Provided GUID found.', ['guid' => static::$parameters['guid'], 'uri-id' => $itemuri['id']]);
+                       Logger::info('Provided GUID found.', ['guid' => $this->parameters['guid'], 'uri-id' => $itemuri['id']]);
                } else {
                        // The item URI does not always contain the GUID. This means that we have to search the URL instead
                        $url = DI::baseUrl()->get() . '/' . DI::args()->getQueryString();
@@ -104,11 +104,11 @@ class Objects extends BaseModule
                        throw new HTTPException\NotFoundException();
                }
 
-               $etag          = md5(static::$parameters['guid'] . '-' . $item['changed']);
+               $etag          = md5($this->parameters['guid'] . '-' . $item['changed']);
                $last_modified = $item['changed'];
                Network::checkEtagModified($etag, $last_modified);
 
-               if (empty(static::$parameters['activity']) && ($item['gravity'] != GRAVITY_ACTIVITY)) {
+               if (empty($this->parameters['activity']) && ($item['gravity'] != GRAVITY_ACTIVITY)) {
                        $activity = ActivityPub\Transmitter::createActivityFromItem($item['id'], true);
                        if (empty($activity['type'])) {
                                throw new HTTPException\NotFoundException();
@@ -123,16 +123,16 @@ class Objects extends BaseModule
 
                        $data = ['@context' => ActivityPub::CONTEXT];
                        $data = array_merge($data, $activity['object']);
-               } elseif (empty(static::$parameters['activity']) || in_array(static::$parameters['activity'],
+               } elseif (empty($this->parameters['activity']) || in_array($this->parameters['activity'],
                        ['Create', 'Announce', 'Update', 'Like', 'Dislike', 'Accept', 'Reject',
                        'TentativeAccept', 'Follow', 'Add'])) {
                        $data = ActivityPub\Transmitter::createActivityFromItem($item['id']);
                        if (empty($data)) {
                                throw new HTTPException\NotFoundException();
                        }
-                       if (!empty(static::$parameters['activity']) && (static::$parameters['activity'] != 'Create')) {
-                               $data['type'] = static::$parameters['activity'];
-                               $data['id'] = str_replace('/Create', '/' . static::$parameters['activity'], $data['id']);
+                       if (!empty($this->parameters['activity']) && ($this->parameters['activity'] != 'Create')) {
+                               $data['type'] = $this->parameters['activity'];
+                               $data['id'] = str_replace('/Create', '/' . $this->parameters['activity'], $data['id']);
                        }
                } else {
                        throw new HTTPException\NotFoundException();
index 55144ce1b0878512bdd5ed326c599a1abb589f09..c459a55e30e50622550a9afe2d7102d900520130 100644 (file)
@@ -33,11 +33,11 @@ class Outbox extends BaseModule
 {
        public function rawContent()
        {
-               if (empty(static::$parameters['nickname'])) {
+               if (empty($this->parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
-               $owner = User::getOwnerDataByNick(static::$parameters['nickname']);
+               $owner = User::getOwnerDataByNick($this->parameters['nickname']);
                if (empty($owner)) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
index 7748926cc869250cc97ac8826c889c290594ae56..bab52fb0de5edc3a49fdd259dd162e7cc2cdee7b 100644 (file)
@@ -34,7 +34,7 @@ class Details extends BaseAdmin
        {
                self::checkAdminAccess();
 
-               $addon = Strings::sanitizeFilePathItem(static::$parameters['addon']);
+               $addon = Strings::sanitizeFilePathItem($this->parameters['addon']);
 
                $redirect = 'admin/addons/' . $addon;
 
@@ -60,7 +60,7 @@ class Details extends BaseAdmin
 
                $addons_admin = Addon::getAdminList();
 
-               $addon = Strings::sanitizeFilePathItem(static::$parameters['addon']);
+               $addon = Strings::sanitizeFilePathItem($this->parameters['addon']);
                if (!is_file("addon/$addon/$addon.php")) {
                        notice(DI::l10n()->t('Addon not found.'));
                        Addon::uninstall($addon);
index 90588cfa91411963e8500b631fa0e0a691acbbeb..6ef8d804aed80c6d9dee05c10c30c10b11fc7711 100644 (file)
@@ -36,8 +36,8 @@ class DBSync extends BaseAdmin
 
                $a = DI::app();
 
-               $action = static::$parameters['action'] ?? '';
-               $update = static::$parameters['update'] ?? 0;
+               $action = $this->parameters['action'] ?? '';
+               $update = $this->parameters['update'] ?? 0;
 
                switch ($action) {
                        case 'mark':
index 9b81d9e766bcb6587fadfc7591daae466be0ce66..c1edabf60866dde385587ecddafc820dc023a547 100644 (file)
@@ -33,7 +33,7 @@ class Source extends BaseAdmin
        {
                parent::content();
 
-               $guid = basename($_REQUEST['guid'] ?? static::$parameters['guid'] ?? '');
+               $guid = basename($_REQUEST['guid'] ?? $this->parameters['guid'] ?? '');
 
                $source = '';
                $item_uri = '';
index b3460c9aab38ea6c26604b417d9707450ba2c079..f43dfdc095e1cdbbdb017f1e73caa2d4943aef58 100644 (file)
@@ -42,7 +42,7 @@ class Queue extends BaseAdmin
        {
                parent::content();
 
-               $status = static::$parameters['status'] ?? '';
+               $status = $this->parameters['status'] ?? '';
 
                // get jobs from the workerqueue table
                if ($status == 'deferred') {
index d0d9c3aa4efd00d926ed1e50dfa58d7972d5b55b..68d7d065d0c945eca4e0650b53d245b494edb35e 100644 (file)
@@ -37,7 +37,7 @@ class Storage extends BaseAdmin
 
                self::checkFormSecurityTokenRedirectOnError('/admin/storage', 'admin_storage');
 
-               $storagebackend = trim(static::$parameters['name'] ?? '');
+               $storagebackend = trim($this->parameters['name'] ?? '');
 
                try {
                        /** @var ICanConfigureStorage|false $newStorageConfig */
index b81b76ab32f1942aa7fd215025bf168c031320d3..b7161d1b96432f79d3579ea943357ef29ad668cb 100644 (file)
@@ -34,7 +34,7 @@ class Details extends BaseAdmin
        {
                parent::content();
 
-               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
                if (!is_dir("view/theme/$theme")) {
                        notice(DI::l10n()->t("Item not found."));
                        return '';
index 27793380223629916d79ba74371d0d4cd1a65bff..bf4e5b556014d13830e25aa068b4811a41116615 100644 (file)
@@ -30,7 +30,7 @@ class Embed extends BaseAdmin
 {
        public function init()
        {
-               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
                if (is_file("view/theme/$theme/config.php")) {
                        DI::app()->setCurrentTheme($theme);
                }
@@ -40,7 +40,7 @@ class Embed extends BaseAdmin
        {
                self::checkAdminAccess();
 
-               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
                if (is_file("view/theme/$theme/config.php")) {
                        require_once "view/theme/$theme/config.php";
                        if (function_exists('theme_admin_post')) {
@@ -60,7 +60,7 @@ class Embed extends BaseAdmin
        {
                parent::content();
 
-               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
                if (!is_dir("view/theme/$theme")) {
                        notice(DI::l10n()->t('Unknown theme.'));
                        return '';
index 3c0b00debcf655f85c19a1631ac44978bd65c020..17c8372b004bf11de5788d183c81ac58783124e2 100644 (file)
@@ -52,7 +52,7 @@ class Tos extends BaseAdmin
        {
                parent::content();
 
-               $tos = new \Friendica\Module\Tos(static::$parameters);
+               $tos = new \Friendica\Module\Tos($this->parameters);
                $t = Renderer::getMarkupTemplate('admin/tos.tpl');
                return Renderer::replaceMacros($t, [
                        '$title' => DI::l10n()->t('Administration'),
index 613c897649263cff0b8cda7c0b602846fff56338..6bcd22be4e1a1f82a8bf19eacbd6a8b73b53b134 100644 (file)
@@ -64,8 +64,8 @@ class Active extends BaseUsers
        {
                parent::content();
 
-               $action = static::$parameters['action'] ?? '';
-               $uid = static::$parameters['uid'] ?? 0;
+               $action = $this->parameters['action'] ?? '';
+               $uid = $this->parameters['uid'] ?? 0;
 
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
index 9ef6dab87d144ec76d37ddbbd4af393f7036e34c..a24c95df0b4bb7d37b9d4566ce9b787bcb17b1e0 100644 (file)
@@ -65,8 +65,8 @@ class Blocked extends BaseUsers
        {
                parent::content();
 
-               $action = static::$parameters['action'] ?? '';
-               $uid = static::$parameters['uid'] ?? 0;
+               $action = $this->parameters['action'] ?? '';
+               $uid = $this->parameters['uid'] ?? 0;
 
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
index dff00083b20b35fe1548dca3f9fe3504c493c952..eb7b57c25c8fc9906171d40ac5ff313dc7414330 100644 (file)
@@ -71,8 +71,8 @@ class Index extends BaseUsers
        {
                parent::content();
 
-               $action = static::$parameters['action'] ?? '';
-               $uid = static::$parameters['uid'] ?? 0;
+               $action = $this->parameters['action'] ?? '';
+               $uid = $this->parameters['uid'] ?? 0;
 
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
index eb90db7b9308faf04af09ee0d3e2a5d77a35f38c..801c159742307f93ee1c67599c9374d5194d2ea6 100644 (file)
@@ -62,8 +62,8 @@ class Pending extends BaseUsers
        {
                parent::content();
 
-               $action = static::$parameters['action'] ?? '';
-               $uid = static::$parameters['uid'] ?? 0;
+               $action = $this->parameters['action'] ?? '';
+               $uid = $this->parameters['uid'] ?? 0;
 
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
index 5f28297b424a60e3dbc88454517e0438025ee5f4..1b2b95d06add6339b13a1a71e62b3c29e7ad841c 100644 (file)
@@ -49,17 +49,17 @@ class Activity extends BaseApi
                        'id' => 0, // Id of the post
                ]);
 
-               $res = Item::performActivity($request['id'], static::$parameters['verb'], $uid);
+               $res = Item::performActivity($request['id'], $this->parameters['verb'], $uid);
 
                if ($res) {
-                       if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
+                       if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) {
                                $ok = 'true';
                        } else {
                                $ok = 'ok';
                        }
-                       DI::apiResponse()->exit('ok', ['ok' => $ok], static::$parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('ok', ['ok' => $ok], $this->parameters['extension'] ?? null);
                } else {
-                       DI::apiResponse()->error(500, 'Error adding activity', '', static::$parameters['extension'] ?? null);
+                       DI::apiResponse()->error(500, 'Error adding activity', '', $this->parameters['extension'] ?? null);
                }
        }
 }
index 944376aad48aa73bad328066711c81aa583fdeba..600d5fe1710d36a4650951006f384f2cce5da5db 100644 (file)
@@ -42,13 +42,13 @@ class Setseen extends BaseApi
                // return error if id is zero
                if (empty($request['id'])) {
                        $answer = ['result' => 'error', 'message' => 'message id not specified'];
-                       DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], static::$parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
                }
 
                // error message if specified id is not in database
                if (!DBA::exists('mail', ['id' => $request['id'], 'uid' => $uid])) {
                        $answer = ['result' => 'error', 'message' => 'message id not in database'];
-                       DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], static::$parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
                }
 
                // update seen indicator
@@ -58,6 +58,6 @@ class Setseen extends BaseApi
                        $answer = ['result' => 'error', 'message' => 'unknown error'];
                }
 
-               DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], static::$parameters['extension'] ?? null);
+               DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
        }
 }
index 439e021f36ca4a3e8db31d089fe333e7af732876..b6cfdd098206f8a006e96e331cade05b1694bec1 100644 (file)
@@ -70,6 +70,6 @@ class Index extends BaseApi
                        ];
                }
 
-               DI::apiResponse()->exit('events', ['events' => $items], static::$parameters['extension'] ?? null);
+               DI::apiResponse()->exit('events', ['events' => $items], $this->parameters['extension'] ?? null);
        }
 }
index 3057c8cb777c2f87601ed243857c1d2894591d8f..9d316d94dad2cc44d7c19433df4d711f8a133a83 100644 (file)
@@ -43,7 +43,7 @@ class Notification extends BaseApi
                        $notifications[] = new ApiNotification($Notify);
                }
 
-               if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
+               if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) {
                        $xmlnotes = [];
                        foreach ($notifications as $notification) {
                                $xmlnotes[] = ['@attributes' => $notification->toArray()];
@@ -56,6 +56,6 @@ class Notification extends BaseApi
                        $result = false;
                }
 
-               DI::apiResponse()->exit('notes', ['note' => $result], static::$parameters['extension'] ?? null);
+               DI::apiResponse()->exit('notes', ['note' => $result], $this->parameters['extension'] ?? null);
        }
 }
index d98296625813f1ebcbdc48cce80db8baadcf473a..ab749b4e8740ce54eaca6da16cd8da6a4f7f22af 100644 (file)
@@ -64,7 +64,7 @@ class Delete extends BaseApi
                        Item::deleteForUser($condition, $uid);
 
                        $result = ['result' => 'deleted', 'message' => 'photo with id `' . $request['photo_id'] . '` has been deleted from server.'];
-                       DI::apiResponse()->exit('photo_delete', ['$result' => $result], static::$parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('photo_delete', ['$result' => $result], $this->parameters['extension'] ?? null);
                } else {
                        throw new InternalServerErrorException("unknown error on deleting photo from database table");
                }
index 01d05f44b0967c226ec7ce2cc4a9a03af0c020c5..0a403270d1585d80316fd3373047403df75bca21 100644 (file)
@@ -67,7 +67,7 @@ class Delete extends BaseApi
                // return success of deletion or error message
                if ($result) {
                        $answer = ['result' => 'deleted', 'message' => 'album `' . $request['album'] . '` with all containing photos has been deleted.'];
-                       DI::apiResponse()->exit('photoalbum_delete', ['$result' => $answer], static::$parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('photoalbum_delete', ['$result' => $answer], $this->parameters['extension'] ?? null);
                } else {
                        throw new InternalServerErrorException("unknown error - deleting from database failed");
                }
index b45f6ced416f005c896b1180d2f1cc75af929821..9fc89dbf6d2defe1c4d1858ed853af003bcb0fe5 100644 (file)
@@ -59,7 +59,7 @@ class Update extends BaseApi
                // return success of updating or error message
                if ($result) {
                        $answer = ['result' => 'updated', 'message' => 'album `' . $request['album'] . '` with all containing photos has been renamed to `' . $request['album_new'] . '`.'];
-                       DI::apiResponse()->exit('photoalbum_update', ['$result' => $answer], static::$parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('photoalbum_update', ['$result' => $answer], $this->parameters['extension'] ?? null);
                } else {
                        throw new InternalServerErrorException("unknown error - updating in database failed");
                }
index a1280eb7c90e8fdfa207b0cd63b530896272dfea..fe0315a84dd0deb06835e2aa30cb54648e7f3aa6 100644 (file)
@@ -49,7 +49,7 @@ class Show extends BaseApi
                $profile = self::formatProfile($profile, $profileFields);
 
                $profiles = [];
-               if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
+               if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) {
                        $profiles['0:profile'] = $profile;
                } else {
                        $profiles[] = $profile;
@@ -65,7 +65,7 @@ class Show extends BaseApi
                        'profiles' => $profiles
                ];
 
-               DI::apiResponse()->exit('friendica_profiles', ['$result' => $result], static::$parameters['extension'] ?? null);
+               DI::apiResponse()->exit('friendica_profiles', ['$result' => $result], $this->parameters['extension'] ?? null);
        }
 
        /**
index d8ff5c95faf8ee1129d555851a5a3c2321bf50c8..c9c7b98fd1f6f4509a9bd57bf925ce0090d58b5e 100644 (file)
@@ -31,6 +31,6 @@ class Version extends BaseApi
 {
        public function rawContent()
        {
-               DI::apiResponse()->exit('version', ['version' => '0.9.7'], static::$parameters['extension'] ?? null);
+               DI::apiResponse()->exit('version', ['version' => '0.9.7'], $this->parameters['extension'] ?? null);
        }
 }
index d157822862c96d8c7a2bf27f4063587171f813ba..78f18c3e60b3b19d937f284502121631280928e1 100644 (file)
@@ -31,12 +31,12 @@ class Test extends BaseApi
 {
        public function rawContent()
        {
-               if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
+               if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) {
                        $ok = 'true';
                } else {
                        $ok = 'ok';
                }
 
-               DI::apiResponse()->exit('ok', ['ok' => $ok], static::$parameters['extension'] ?? null);
+               DI::apiResponse()->exit('ok', ['ok' => $ok], $this->parameters['extension'] ?? null);
        }
 }
index 13981684f08d9e32d0a2a86749c22e2089d38dbd..552889661b2ee9d5bedf10d3cdd42d13beb36721 100644 (file)
@@ -39,20 +39,20 @@ class Accounts extends BaseApi
        {
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id']) && empty(static::$parameters['name'])) {
+               if (empty($this->parameters['id']) && empty($this->parameters['name'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               if (!empty(static::$parameters['id'])) {
-                       $id = static::$parameters['id'];
+               if (!empty($this->parameters['id'])) {
+                       $id = $this->parameters['id'];
                        if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                                DI::mstdnError()->RecordNotFound();
                        }
                } else {
-                       $contact = Contact::selectFirst(['id'], ['nick' => static::$parameters['name'], 'uid' => 0]);
+                       $contact = Contact::selectFirst(['id'], ['nick' => $this->parameters['name'], 'uid' => 0]);
                        if (!empty($contact['id'])) {
                                $id = $contact['id'];
-                       } elseif (!($id = Contact::getIdForURL(static::$parameters['name'], 0, false))) {
+                       } elseif (!($id = Contact::getIdForURL($this->parameters['name'], 0, false))) {
                                DI::mstdnError()->RecordNotFound();
                        }
                }
index 522eeb11f59cb788091aa24c0a6c1192d4922d82..b2ae98bd56dc290929be4761b70ab99cfa3fef9d 100644 (file)
@@ -37,7 +37,7 @@ class Block extends BaseApi
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -46,7 +46,7 @@ class Block extends BaseApi
                        DI::mstdnError()->Forbidden();
                }
 
-               $cdata = Contact::getPublicAndUserContactID(static::$parameters['id'], $uid);
+               $cdata = Contact::getPublicAndUserContactID($this->parameters['id'], $uid);
                if (empty($cdata['user'])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -62,6 +62,6 @@ class Block extends BaseApi
                Contact::terminateFriendship($owner, $contact);
                Contact::revokeFollow($contact);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index 3ed761172402268ab1cf4314f293a340fd0dc454..86b932421dbde85d4656f665ccdfb522dfc8a5c7 100644 (file)
@@ -36,11 +36,11 @@ class Follow extends BaseApi
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $cid = Contact::follow(static::$parameters['id'], $uid);
+               $cid = Contact::follow($this->parameters['id'], $uid);
 
                System::jsonExit(DI::mstdnRelationship()->createFromContactId($cid, $uid)->toArray());
        }
index 3270da828caff0f22634c5d527c6e2d70a0d8e58..981d2c715d556680d69bfa26e263fcbe9afebbe5 100644 (file)
@@ -39,11 +39,11 @@ class Followers extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -72,7 +72,7 @@ class Followers extends BaseApi
                        $params['order'] = ['cid'];
                }
 
-               $followers = DBA::select('contact-relation', ['relation-cid'], $condition, static::$parameters);
+               $followers = DBA::select('contact-relation', ['relation-cid'], $condition, $this->parameters);
                while ($follower = DBA::fetch($followers)) {
                        self::setBoundaries($follower['relation-cid']);
                        $accounts[] = DI::mstdnAccount()->createFromContactId($follower['relation-cid'], $uid);
index 9768d2a039a4b9da196ed700ecf2d6124ab3377d..41352ddaf5496acf26a138dcecaed2d2645b81dd 100644 (file)
@@ -39,11 +39,11 @@ class Following extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -72,7 +72,7 @@ class Following extends BaseApi
                        $params['order'] = ['cid'];
                }
 
-               $followers = DBA::select('contact-relation', ['cid'], $condition, static::$parameters);
+               $followers = DBA::select('contact-relation', ['cid'], $condition, $this->parameters);
                while ($follower = DBA::fetch($followers)) {
                        self::setBoundaries($follower['cid']);
                        $accounts[] = DI::mstdnAccount()->createFromContactId($follower['cid'], $uid);
index 4860c4fe53e1da5bf1277f46e6a1d1f87eedc8b6..f34b961b6394efe704b77ba340276606e262a00b 100644 (file)
@@ -40,11 +40,11 @@ class Lists extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
index 159afdfd93b8b426ced3826787b8068d3be2a392..1c711db750dc48a6fa0c8fcc690f6bbea853f5f4 100644 (file)
@@ -36,12 +36,12 @@ class Mute extends BaseApi
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Contact\User::setIgnored(static::$parameters['id'], $uid, true);
+               Contact\User::setIgnored($this->parameters['id'], $uid, true);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index d14afbb484d562378a6021d4278c21a6ea1bc58f..fe4611754d98fd9562d56337a311805fd24ea7d9 100644 (file)
@@ -37,7 +37,7 @@ class Note extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -45,13 +45,13 @@ class Note extends BaseApi
                        'comment' => '',
                ]);
 
-               $cdata = Contact::getPublicAndUserContactID(static::$parameters['id'], $uid);
+               $cdata = Contact::getPublicAndUserContactID($this->parameters['id'], $uid);
                if (empty($cdata['user'])) {
                        DI::mstdnError()->RecordNotFound();
                }
 
                Contact::update(['info' => $request['comment']], ['id' => $cdata['user']]);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index 1c95d74c7bb0267ce5797df11df2c002c5c616a8..5bf7b49346807c1f8e9be0f30fd3a638e8b6a2d2 100644 (file)
@@ -43,11 +43,11 @@ class Statuses extends BaseApi
        {
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
index aed46c3325400a8c95238092ea531be49c3964d1..ae2414b8acc55a248f04e9d01189e723d24df943 100644 (file)
@@ -36,12 +36,12 @@ class Unblock extends BaseApi
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Contact\User::setBlocked(static::$parameters['id'], $uid, false);
+               Contact\User::setBlocked($this->parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index 78b6bad62e38bd5c916144f9b81dd060a7e85152..a15c946bb60525bee7d1e29b75ab054ca74d9284 100644 (file)
@@ -36,12 +36,12 @@ class Unfollow extends BaseApi
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Contact::unfollow(static::$parameters['id'], $uid);
+               Contact::unfollow($this->parameters['id'], $uid);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index 3e9146f2186f413c7ec8f9d2a866ffb49c51b8ad..d1410f78246ee21c3770438cb3f32b2137f1fde8 100644 (file)
@@ -36,12 +36,12 @@ class Unmute extends BaseApi
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Contact\User::setIgnored(static::$parameters['id'], $uid, false);
+               Contact\User::setIgnored($this->parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index c141b04823bab856fca14975e3330f047e088520..b6a26d9733802c1228f7211f127e0ab5a35baa63 100644 (file)
@@ -39,11 +39,11 @@ class Blocks extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -72,7 +72,7 @@ class Blocks extends BaseApi
                        $params['order'] = ['cid'];
                }
 
-               $followers = DBA::select('user-contact', ['cid'], $condition, static::$parameters);
+               $followers = DBA::select('user-contact', ['cid'], $condition, $this->parameters);
                while ($follower = DBA::fetch($followers)) {
                        self::setBoundaries($follower['cid']);
                        $accounts[] = DI::mstdnAccount()->createFromContactId($follower['cid'], $uid);
index fbee5672ef9693584d352806be84749d6ba6341e..a3f6a26a281d1a258851c52556fbc39465678ad7 100644 (file)
@@ -36,12 +36,12 @@ class Conversations extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (!empty(static::$parameters['id'])) {
+               if (!empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               DBA::delete('conv', ['id' => static::$parameters['id'], 'uid' => $uid]);
-               DBA::delete('mail', ['convid' => static::$parameters['id'], 'uid' => $uid]);
+               DBA::delete('conv', ['id' => $this->parameters['id'], 'uid' => $uid]);
+               DBA::delete('mail', ['convid' => $this->parameters['id'], 'uid' => $uid]);
 
                System::jsonExit([]);
        }
index 27f012c01bc562b2f4702a2ff0a24a77d16a7a7d..1eadc671c193ec20d47283749606739e580a61fa 100644 (file)
@@ -36,12 +36,12 @@ class Read extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (!empty(static::$parameters['id'])) {
+               if (!empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               DBA::update('mail', ['seen' => true], ['convid' => static::$parameters['id'], 'uid' => $uid]);
+               DBA::update('mail', ['seen' => true], ['convid' => $this->parameters['id'], 'uid' => $uid]);
 
-               System::jsonExit(DI::mstdnConversation()->CreateFromConvId(static::$parameters['id'])->toArray());
+               System::jsonExit(DI::mstdnConversation()->CreateFromConvId($this->parameters['id'])->toArray());
        }
 }
index a334b897a8d47115c6519b0dc39e7da1f9033009..af4ac5771f8f3db4d889894dfbd553754b98a303 100644 (file)
@@ -47,11 +47,11 @@ class FollowRequests extends BaseApi
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               $introduction = DI::intro()->selectOneById(static::$parameters['id'], $uid);
+               $introduction = DI::intro()->selectOneById($this->parameters['id'], $uid);
 
                $contactId = $introduction->cid;
 
-               switch (static::$parameters['action']) {
+               switch ($this->parameters['action']) {
                        case 'authorize':
                                Contact\Introduction::confirm($introduction);
                                $relationship = DI::mstdnRelationship()->createFromContactId($contactId, $uid);
index 8a3f7a0ad4a7fe9396abe4c96bc06292b1ea0421..e7a66f04db8559a80caab845a4b2bedfb03de375 100644 (file)
@@ -36,15 +36,15 @@ class Lists extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               if (!Group::exists(static::$parameters['id'], $uid)) {
+               if (!Group::exists($this->parameters['id'], $uid)) {
                        DI::mstdnError()->RecordNotFound();
                }
 
-               if (!Group::remove(static::$parameters['id'])) {
+               if (!Group::remove($this->parameters['id'])) {
                        DI::mstdnError()->InternalError();
                }
 
@@ -81,11 +81,11 @@ class Lists extends BaseApi
                        'replies_policy' => '', // One of: "followed", "list", or "none".
                ]);
 
-               if (empty($request['title']) || empty(static::$parameters['id'])) {
+               if (empty($request['title']) || empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Group::update(static::$parameters['id'], $request['title']);
+               Group::update($this->parameters['id'], $request['title']);
        }
 
        /**
@@ -96,7 +96,7 @@ class Lists extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        $lists = [];
 
                        $groups = Group::getByUserId($uid);
@@ -105,7 +105,7 @@ class Lists extends BaseApi
                                $lists[] = DI::mstdnList()->createFromGroupId($group['id']);
                        }
                } else {
-                       $id = static::$parameters['id'];
+                       $id = $this->parameters['id'];
 
                        if (!Group::exists($id, $uid)) {
                                DI::mstdnError()->RecordNotFound();
index cdc75b6d4994d28cbceb2ef82ae4e21d7c63157c..c70e20349b7fe0e6272c5e8a0dcaf3920306f42d 100644 (file)
@@ -53,11 +53,11 @@ class Accounts extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!DBA::exists('group', ['id' => $id, 'uid' => $uid])) {
                        DI::mstdnError()->RecordNotFound();
                }
index cd858f5eeb9e9cd7ec55befa7bc3efb778818810..dc31bdec683a22a3e874714cf1ab5c3799ee98c4 100644 (file)
@@ -65,18 +65,18 @@ class Media extends BaseApi
                        'focus'       => '', // Two floating points (x,y), comma-delimited ranging from -1.0 to 1.0
                ]);
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $photo = Photo::selectFirst(['resource-id'], ['id' => static::$parameters['id'], 'uid' => $uid]);
+               $photo = Photo::selectFirst(['resource-id'], ['id' => $this->parameters['id'], 'uid' => $uid]);
                if (empty($photo['resource-id'])) {
                        DI::mstdnError()->RecordNotFound();
                }
 
                Photo::update(['desc' => $request['description']], ['resource-id' => $photo['resource-id']]);
 
-               System::jsonExit(DI::mstdnAttachment()->createFromPhoto(static::$parameters['id']));
+               System::jsonExit(DI::mstdnAttachment()->createFromPhoto($this->parameters['id']));
        }
 
        /**
@@ -87,11 +87,11 @@ class Media extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!Photo::exists(['id' => $id, 'uid' => $uid])) {
                        DI::mstdnError()->RecordNotFound();
                }
index b5ba3fcfd5928618c53b418dc2bac45d9c6820ea..3c24071f0773d9e8ab9b8a7681eef4d5758e6b6e 100644 (file)
@@ -39,11 +39,11 @@ class Mutes extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -72,7 +72,7 @@ class Mutes extends BaseApi
                        $params['order'] = ['cid'];
                }
 
-               $followers = DBA::select('user-contact', ['cid'], $condition, static::$parameters);
+               $followers = DBA::select('user-contact', ['cid'], $condition, $this->parameters);
                while ($follower = DBA::fetch($followers)) {
                        self::setBoundaries($follower['cid']);
                        $accounts[] = DI::mstdnAccount()->createFromContactId($follower['cid'], $uid);
index c2ddf2a4df6bd7fd14e176411fd9d30654588931..274a8578668f6670f9e4ad709cdfcdfc1254255e 100644 (file)
@@ -45,8 +45,8 @@ class Notifications extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (!empty(static::$parameters['id'])) {
-                       $id = static::$parameters['id'];
+               if (!empty($this->parameters['id'])) {
+                       $id = $this->parameters['id'];
                        try {
                                $notification = DI::notification()->selectOneForUser($uid, ['id' => $id]);
                                System::jsonExit(DI::mstdnNotification()->createFromNotification($notification));
index b135b5bbf505423385bba0c5f5981e9967eb0092..b978e46eeefd775f696399fd4290b968d5f48a88 100644 (file)
@@ -37,11 +37,11 @@ class Dismiss extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $Notification = DI::notification()->selectOneForUser($uid, static::$parameters['id']);
+               $Notification = DI::notification()->selectOneForUser($uid, $this->parameters['id']);
                $Notification->setSeen();
                DI::notification()->save($Notification);
 
index b229293819570ad7f474b4b0cba26a474e9a08ae..bfb2cff455eb82afc2f7a28454504d1ff729b469 100644 (file)
@@ -47,15 +47,15 @@ class ScheduledStatuses extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               if (!DBA::exists('delayed-post', ['id' => static::$parameters['id'], 'uid' => $uid])) {
+               if (!DBA::exists('delayed-post', ['id' => $this->parameters['id'], 'uid' => $uid])) {
                        DI::mstdnError()->RecordNotFound();
                }
 
-               Post\Delayed::deleteById(static::$parameters['id']);
+               Post\Delayed::deleteById($this->parameters['id']);
 
                System::jsonExit([]);
        }
@@ -68,8 +68,8 @@ class ScheduledStatuses extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (isset(static::$parameters['id'])) {
-                       System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId(static::$parameters['id'], $uid)->toArray());
+               if (isset($this->parameters['id'])) {
+                       System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($this->parameters['id'], $uid)->toArray());
                }
 
                $request = self::getRequest([
index dc7c856ac604a9cbc15cb456f0c70bafbf7c3aa1..6753b090983989ab311e7ea93634c4809a7d95b1 100644 (file)
@@ -73,7 +73,7 @@ class Search extends BaseApi
                        $result['statuses'] = self::searchStatuses($uid, $request['q'], $request['account_id'], $request['max_id'], $request['min_id'], $limit, $request['offset']);
                }
                if ((empty($request['type']) || ($request['type'] == 'hashtags')) && (strpos($request['q'], '@') == false)) {
-                       $result['hashtags'] = self::searchHashtags($request['q'], $request['exclude_unreviewed'], $limit, $request['offset'], static::$parameters['version']);
+                       $result['hashtags'] = self::searchHashtags($request['q'], $request['exclude_unreviewed'], $limit, $request['offset'], $this->parameters['version']);
                }
 
                System::jsonExit($result);
index 8ffeef07a2f657597c560711707861eb77c819e3..50c35f34772dd4f9427d04e8ef33f278867e89cf 100644 (file)
@@ -212,11 +212,11 @@ class Statuses extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => static::$parameters['id'], 'uid' => $uid]);
+               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => $this->parameters['id'], 'uid' => $uid]);
                if (empty($item['id'])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -235,10 +235,10 @@ class Statuses extends BaseApi
        {
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid));
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid));
        }
 }
index 4d2f096cd05482203727fc13a3bbe3679f0f37e0..de0ef641d34ce33bcc89ba812e9b43488079851a 100644 (file)
@@ -38,11 +38,11 @@ class Bookmark extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -53,6 +53,6 @@ class Bookmark extends BaseApi
 
                Item::update(['starred' => true], ['id' => $item['id']]);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index 698dfab8c5b4d896c1cdcf0d62297daf9c069db1..d3c1801a29ed9a844f6a85304d679b871d87aed5 100644 (file)
@@ -39,11 +39,11 @@ class Card extends BaseApi
        {
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
 
                if (!Post::exists(['uri-id' => $id, 'uid' => [0, $uid]])) {
                        throw new HTTPException\NotFoundException('Item with URI ID ' . $id . ' not found' . ($uid ? ' for user ' . $uid : '.'));
index da59bb1d96c5fec6dfe79ebf6de27d8430df0f5b..03782ef1ce4d44df115b3f262884d35abb5c45c8 100644 (file)
@@ -39,7 +39,7 @@ class Context extends BaseApi
        {
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -47,7 +47,7 @@ class Context extends BaseApi
                        'limit'    => 40, // Maximum number of results to return. Defaults to 40.
                ]);
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
 
                $parents  = [];
                $children = [];
index 3fe55807b688d959d2b4e3472a0a84003a65767e..8ec818a8ff84570fc1797d9dce14708faf16f8ce 100644 (file)
@@ -38,17 +38,17 @@ class Favourite extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
 
                Item::performActivity($item['id'], 'like', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index b6726cc54d0770c219a24a37fdbbb93a5e1ea7d2..37d9e7521a6951719195746632c0e2151c63a481 100644 (file)
@@ -39,11 +39,11 @@ class FavouritedBy extends BaseApi
        {
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!Post::exists(['uri-id' => $id, 'uid' => [0, $uid]])) {
                        DI::mstdnError()->RecordNotFound();
                }
index 739126d5819a8af2bff56e0437d2ce057d789709..4a0e943f344d1a00f2ae9cbf233c470d03d84e6e 100644 (file)
@@ -37,11 +37,11 @@ class Mute extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -50,8 +50,8 @@ class Mute extends BaseApi
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be muted'));
                }
 
-               Post\ThreadUser::setIgnored(static::$parameters['id'], $uid, true);
+               Post\ThreadUser::setIgnored($this->parameters['id'], $uid, true);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index b7573fd9d1d8b607fdce8e8ac68d2ca18eeaba9b..7648d12a0b34d1affb54bb0513c9aabf484b2c39 100644 (file)
@@ -37,11 +37,11 @@ class Pin extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -50,8 +50,8 @@ class Pin extends BaseApi
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be pinned'));
                }
 
-               Post\ThreadUser::setPinned(static::$parameters['id'], $uid, true);
+               Post\ThreadUser::setPinned($this->parameters['id'], $uid, true);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index 136491bf26105cf840333d941b8e3866905c174c..d10149616a638742dadfb92703b8b8718145aa67 100644 (file)
@@ -40,11 +40,11 @@ class Reblog extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'network'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'network'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -55,6 +55,6 @@ class Reblog extends BaseApi
 
                Item::performActivity($item['id'], 'announce', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index de2004b861cf346d61e5253ad42590f9d0618bc9..52f1e2f67d1861d7e76802cb79126b654537debf 100644 (file)
@@ -39,11 +39,11 @@ class RebloggedBy extends BaseApi
        {
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = static::$parameters['id'];
+               $id = $this->parameters['id'];
                if (!Post::exists(['uri-id' => $id, 'uid' => [0, $uid]])) {
                        DI::mstdnError()->RecordNotFound();
                }
index d6bd6fcc8c5e0b7a0f566a885c0be1fddd40eb71..9279fec60e38f2a022f4e19fa11b6edbba5ce7ab 100644 (file)
@@ -38,11 +38,11 @@ class Unbookmark extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -53,6 +53,6 @@ class Unbookmark extends BaseApi
 
                Item::update(['starred' => false], ['id' => $item['id']]);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index 244b38cd1da1c7cf740cc44969e06ef744e2d785..7898647acc50caa2999b9b3d10d7ac230a3f72f2 100644 (file)
@@ -38,17 +38,17 @@ class Unfavourite extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
 
                Item::performActivity($item['id'], 'unlike', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index a659b5b079e753d14dbe76de7e4e8652b90a5167..80b9c2c541f46ddebca3121b7483084453bd37ce 100644 (file)
@@ -37,11 +37,11 @@ class Unmute extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -50,8 +50,8 @@ class Unmute extends BaseApi
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be unmuted'));
                }
 
-               Post\ThreadUser::setIgnored(static::$parameters['id'], $uid, false);
+               Post\ThreadUser::setIgnored($this->parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index 1eaf73409a7e63d0be1ab024cda46ea7734e863e..21f44b7cbb2f1cf4d9263d2979c96ef4abfc5aee 100644 (file)
@@ -37,11 +37,11 @@ class Unpin extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -50,8 +50,8 @@ class Unpin extends BaseApi
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be pinned'));
                }
 
-               Post\ThreadUser::setPinned(static::$parameters['id'], $uid, false);
+               Post\ThreadUser::setPinned($this->parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index 234d1058f32184811cc12938313221e157043c73..972a6aa1aff69957c9683bc6a3aa401936a478b9 100644 (file)
@@ -40,11 +40,11 @@ class Unreblog extends BaseApi
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'network'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'network'], ['uri-id' => $this->parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -55,6 +55,6 @@ class Unreblog extends BaseApi
 
                Item::performActivity($item['id'], 'unannounce', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
        }
 }
index 6d58153119543e20f2e18d7e8b7b58fdd03a5dad..c9316fdf53b194ee57727ba891e765831d455cf2 100644 (file)
@@ -41,7 +41,7 @@ class ListTimeline extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -60,7 +60,7 @@ class ListTimeline extends BaseApi
                $params = ['order' => ['uri-id' => true], 'limit' => $request['limit']];
 
                $condition = ["`uid` = ? AND `gravity` IN (?, ?) AND `contact-id` IN (SELECT `contact-id` FROM `group_member` WHERE `gid` = ?)",
-                       $uid, GRAVITY_PARENT, GRAVITY_COMMENT, static::$parameters['id']];
+                       $uid, GRAVITY_PARENT, GRAVITY_COMMENT, $this->parameters['id']];
 
                if (!empty($request['max_id'])) {
                        $condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $request['max_id']]);
index 80ccf5a9c22bc750074dee984b6c58e6dd05e3e8..3571dd73335103cc757aeaa673b95ef4be614899 100644 (file)
@@ -42,7 +42,7 @@ class Tag extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty(static::$parameters['hashtag'])) {
+               if (empty($this->parameters['hashtag'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -69,7 +69,7 @@ class Tag extends BaseApi
 
                $condition = ["`name` = ? AND (`uid` = ? OR (`uid` = ? AND NOT `global`))
                        AND (`network` IN (?, ?, ?, ?) OR (`uid` = ? AND `uid` != ?))",
-                       static::$parameters['hashtag'], 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0];
+                       $this->parameters['hashtag'], 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0];
 
                if ($request['local']) {
                        $condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)"]);
index fa1383b8e03651f8e959504a826e10f8169adfd5..e38ffb061a830778a46aa7e9b325bce86f5a6aab 100644 (file)
@@ -32,7 +32,7 @@ class RateLimitStatus extends BaseApi
 {
        public function rawContent()
        {
-               if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
+               if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) {
                        $hash = [
                                'remaining-hits'        => '150',
                                '@attributes'           => ["type" => "integer"],
@@ -52,6 +52,6 @@ class RateLimitStatus extends BaseApi
                        ];
                }
 
-               DI::apiResponse()->exit('hash', ['hash' => $hash], static::$parameters['extension'] ?? null);
+               DI::apiResponse()->exit('hash', ['hash' => $hash], $this->parameters['extension'] ?? null);
        }
 }
index 8c513a960c5c8d5ce2a5235e9b9fb255a4c14b05..ac75316710e79a82383d36890c4d702fca06395c 100644 (file)
@@ -45,6 +45,6 @@ class SavedSearches extends BaseApi
 
                DBA::close($terms);
 
-               DI::apiResponse()->exit('terms', ['terms' => $result], static::$parameters['extension'] ?? null);
+               DI::apiResponse()->exit('terms', ['terms' => $result], $this->parameters['extension'] ?? null);
        }
 }
index 84961ca2763faddb6dd477239e854487747eb0c9..c35e6b9ba393405be0ac94393a1fbbb1483ae3d5 100644 (file)
@@ -37,11 +37,11 @@ class Attach extends BaseModule
        public function rawContent()
        {
                $a = DI::app();
-               if (empty(static::$parameters['item'])) {
+               if (empty($this->parameters['item'])) {
                        throw new \Friendica\Network\HTTPException\BadRequestException();
                }
 
-               $item_id = intval(static::$parameters['item']);
+               $item_id = intval($this->parameters['item']);
 
                // Check for existence
                $item = MAttach::exists(['id' => $item_id]);
index 53ab31d1a66f92851b38feefb0881c455bc3b7d2..fb3aa62f4f9a98089e79bfd895322cd8b8ed4b68 100644 (file)
@@ -47,7 +47,7 @@ class Advanced extends BaseModule
 
        public function post()
        {
-               $cid = static::$parameters['id'];
+               $cid = $this->parameters['id'];
 
                $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
                if (empty($contact)) {
@@ -98,7 +98,7 @@ class Advanced extends BaseModule
 
        public function content(): string
        {
-               $cid = static::$parameters['id'];
+               $cid = $this->parameters['id'];
 
                $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
                if (empty($contact)) {
index b5b501d6ea68c03e21b1846d02b28082f1394e10..bfe689c1e3997a3c1fac3710509c2287d4b17c30 100644 (file)
@@ -22,8 +22,8 @@ class Contacts extends BaseModule
                        throw new HTTPException\ForbiddenException();
                }
 
-               $cid = static::$parameters['id'];
-               $type = static::$parameters['type'] ?? 'all';
+               $cid = $this->parameters['id'];
+               $type = $this->parameters['type'] ?? 'all';
                $accounttype = $_GET['accounttype'] ?? '';
                $accounttypeid = User::getAccountTypeByString($accounttype);
 
index d9a03995796d1e76dc7be20c377d71f100c40535..a3a498b6d1de8b5c1fea50bcd4f22c92826980bb 100644 (file)
@@ -36,7 +36,7 @@ class Media extends BaseModule
 {
        public function content(): string
        {
-               $cid = static::$parameters['id'];
+               $cid = $this->parameters['id'];
 
                $contact = Model\Contact::selectFirst([], ['id' => $cid]);
                if (empty($contact)) {
index 215e322580dfd97f1128da885f00bf32357fd5b8..23ec95a435ff9f60c96f9d5dad117e9263f48481 100644 (file)
@@ -20,7 +20,7 @@ class Poke extends BaseModule
 {
        public function post()
        {
-               if (!local_user() || empty(static::$parameters['id'])) {
+               if (!local_user() || empty($this->parameters['id'])) {
                        return self::postReturn(false);
                }
 
@@ -39,14 +39,14 @@ class Poke extends BaseModule
 
                $activity = Activity::POKE . '#' . urlencode($verbs[$verb][0]);
 
-               $contact_id = intval(static::$parameters['id']);
+               $contact_id = intval($this->parameters['id']);
                if (!$contact_id) {
                        return self::postReturn(false);
                }
 
                Logger::info('verb ' . $verb . ' contact ' . $contact_id);
 
-               $contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => static::$parameters['id'], 'uid' => local_user()]);
+               $contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => $this->parameters['id'], 'uid' => local_user()]);
                if (!DBA::isResult($contact)) {
                        return self::postReturn(false);
                }
@@ -129,11 +129,11 @@ class Poke extends BaseModule
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
                }
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => static::$parameters['id'], 'uid' => local_user()]);
+               $contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => $this->parameters['id'], 'uid' => local_user()]);
                if (!DBA::isResult($contact)) {
                        throw new HTTPException\NotFoundException();
                }
index 1cace6255fa8d7c0b061b019d77882655f1361ab..07fe7779b53955115d9bdb09eef644a277d392ad 100644 (file)
@@ -43,7 +43,7 @@ class Revoke extends BaseModule
                        return;
                }
 
-               $data = Model\Contact::getPublicAndUserContactID(static::$parameters['id'], local_user());
+               $data = Model\Contact::getPublicAndUserContactID($this->parameters['id'], local_user());
                if (!DBA::isResult($data)) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('Unknown contact.'));
                }
@@ -69,7 +69,7 @@ class Revoke extends BaseModule
                        throw new HTTPException\UnauthorizedException();
                }
 
-               self::checkFormSecurityTokenRedirectOnError('contact/' . static::$parameters['id'], 'contact_revoke');
+               self::checkFormSecurityTokenRedirectOnError('contact/' . $this->parameters['id'], 'contact_revoke');
 
                $result = Model\Contact::revokeFollow(self::$contact);
                if ($result === true) {
@@ -80,7 +80,7 @@ class Revoke extends BaseModule
                        notice(DI::l10n()->t('Unable to revoke follow, please try again later or contact the administrator.'));
                }
 
-               DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
+               DI::baseUrl()->redirect('contact/' . $this->parameters['id']);
        }
 
        public function content(): string
index 58a0c5750b4c536ee58d3555b5322646485c1400..d954ef8f39b70e45ab67d53523bf221a4cc25107 100644 (file)
@@ -51,7 +51,7 @@ class Community extends BaseModule
 
        public function content(): string
        {
-               self::parseRequest();
+               $this->parseRequest();
 
                if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll')) {
                        $tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
@@ -94,8 +94,8 @@ class Community extends BaseModule
        
                        if (local_user() && DI::config()->get('system', 'community_no_sharer')) {
                                $path = self::$content;
-                               if (!empty(static::$parameters['accounttype'])) {
-                                       $path .= '/' . static::$parameters['accounttype'];
+                               if (!empty($this->parameters['accounttype'])) {
+                                       $path .= '/' . $this->parameters['accounttype'];
                                }
                                $query_parameters = [];
                
@@ -169,7 +169,7 @@ class Community extends BaseModule
         * @throws HTTPException\BadRequestException
         * @throws HTTPException\ForbiddenException
         */
-       protected static function parseRequest()
+       protected function parseRequest()
        {
                if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
@@ -181,10 +181,10 @@ class Community extends BaseModule
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
                }
 
-               self::$accountTypeString = $_GET['accounttype'] ?? static::$parameters['accounttype'] ?? '';
+               self::$accountTypeString = $_GET['accounttype'] ?? $this->parameters['accounttype'] ?? '';
                self::$accountType = User::getAccountTypeByString(self::$accountTypeString);
 
-               self::$content = static::$parameters['content'] ?? '';
+               self::$content = $this->parameters['content'] ?? '';
                if (!self::$content) {
                        if (!empty(DI::config()->get('system', 'singleuser'))) {
                                // On single user systems only the global page does make sense
index 06fec9ee7cc2aa57e1de9da743c9981ed537f28c..0f2d9cd6fc92f148488df9c3fad523e9b37cfcf1 100644 (file)
@@ -63,7 +63,7 @@ class Network extends BaseModule
                        return Login::form();
                }
 
-               self::parseRequest($_GET);
+               $this->parseRequest($_GET);
 
                $module = 'network';
 
@@ -272,11 +272,11 @@ class Network extends BaseModule
                return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs']]);
        }
 
-       protected static function parseRequest(array $get)
+       protected function parseRequest(array $get)
        {
-               self::$groupId = static::$parameters['group_id'] ?? 0;
+               self::$groupId = $this->parameters['group_id'] ?? 0;
 
-               self::$forumContactId = static::$parameters['contact_id'] ?? 0;
+               self::$forumContactId = $this->parameters['contact_id'] ?? 0;
 
                self::$selectedTab = Session::get('network-tab', DI::pConfig()->get(local_user(), 'network.view', 'selected_tab', ''));
 
@@ -317,13 +317,13 @@ class Network extends BaseModule
                Session::set('network-tab', self::$selectedTab);
                DI::pConfig()->set(local_user(), 'network.view', 'selected_tab', self::$selectedTab);
 
-               self::$accountTypeString = $get['accounttype'] ?? static::$parameters['accounttype'] ?? '';
+               self::$accountTypeString = $get['accounttype'] ?? $this->parameters['accounttype'] ?? '';
                self::$accountType = User::getAccountTypeByString(self::$accountTypeString);
 
                self::$network = $get['nets'] ?? '';
 
-               self::$dateFrom = static::$parameters['from'] ?? '';
-               self::$dateTo = static::$parameters['to'] ?? '';
+               self::$dateFrom = $this->parameters['from'] ?? '';
+               self::$dateTo = $this->parameters['to'] ?? '';
 
                if (DI::mode()->isMobile()) {
                        self::$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
index cbd658fc915d5fd01f36808d9143dbb24f5ca0aa..eda5da9361cc24eeb5648211e4f9f697a8f3dc84 100644 (file)
@@ -47,8 +47,8 @@ class Notify extends BaseModule
                }
 
                $data = json_decode($postdata);
-               if (is_object($data) && !empty(static::$parameters['nickname'])) {
-                       $user = User::getByNickname(static::$parameters['nickname']);
+               if (is_object($data) && !empty($this->parameters['nickname'])) {
+                       $user = User::getByNickname($this->parameters['nickname']);
                        if (empty($user)) {
                                throw new \Friendica\Network\HTTPException\InternalServerErrorException();
                        }
index 3c4becdd6bc9eb1a8405337554f3348d8af0bf81..0cf43f2a7ef202beb98abdc1126ea4083af72716 100644 (file)
@@ -33,7 +33,7 @@ class Poll extends BaseModule
        {
                header("Content-type: application/atom+xml");
                $last_update = $_GET['last_update'] ?? '';
-               echo OStatus::feed(static::$parameters['nickname'], $last_update, 10);
+               echo OStatus::feed($this->parameters['nickname'], $last_update, 10);
                exit();
        }
 }
index 04dab22c6b3918787b0ddae37f2c9f2d86b7ffd0..3759931145e16ee30423144576f1e421116c708c 100644 (file)
@@ -37,11 +37,11 @@ class ItemBody extends BaseModule
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
                }
 
-               if (empty(static::$parameters['item'])) {
+               if (empty($this->parameters['item'])) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('Item not found.'));
                }
 
-               $itemId = intval(static::$parameters['item']);
+               $itemId = intval($this->parameters['item']);
 
                $item = Post::selectFirst(['body'], ['uid' => [0, local_user()], 'uri-id' => $itemId]);
 
index aa582558f8367e814f15c0895411869f7bcf5031..e3d6f4616efd84e155139f619f5383038cbe6758 100644 (file)
@@ -40,11 +40,11 @@ class Fetch extends BaseModule
 {
        public function rawContent()
        {
-               if (empty(static::$parameters['guid'])) {
+               if (empty($this->parameters['guid'])) {
                        throw new HTTPException\NotFoundException();
                }
 
-               $guid = static::$parameters['guid'];
+               $guid = $this->parameters['guid'];
 
                // Fetch the item
                $condition = ['origin' => true, 'private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $guid,
index 9ac89cc6e66c84e98df700b8d9bfede704318106..14ad5c39125df1ec1ccabd3c2b2bbbb0cb4b8a8c 100644 (file)
@@ -51,10 +51,10 @@ class Receive extends BaseModule
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
                }
 
-               if (static::$parameters['type'] === 'public') {
+               if ($this->parameters['type'] === 'public') {
                        self::receivePublic();
-               } else if (static::$parameters['type'] === 'users') {
-                       self::receiveUser(static::$parameters['guid']);
+               } else if ($this->parameters['type'] === 'users') {
+                       self::receiveUser($this->parameters['guid']);
                }
        }
 
index 94908abe21afed4d7b0c2e97fa8f77ffc043aac8..6470ab5c373b8c9e402e35c153dec0a4dac6d8e8 100644 (file)
@@ -68,7 +68,7 @@ class Feed extends BaseModule
                }
 
                header("Content-type: application/atom+xml; charset=utf-8");
-               echo ProtocolFeed::atom(static::$parameters['nickname'], $last_update, 10, $type, $nocache, true);
+               echo ProtocolFeed::atom($this->parameters['nickname'], $last_update, 10, $type, $nocache, true);
                exit();
        }
 }
index 43a0ff1fb01fb16818aba56916dea725af9c870a..e6749de020ee1d445ec1b1aa0b610912b7fd790a 100644 (file)
@@ -41,7 +41,7 @@ class RemoveTag extends BaseModule
 
                $logger = DI::logger();
 
-               $item_id = static::$parameters['id'] ?? 0;
+               $item_id = $this->parameters['id'] ?? 0;
 
                $term = XML::unescape(trim($_GET['term'] ?? ''));
                $cat = XML::unescape(trim($_GET['cat'] ?? ''));
index ee620f54c68ea7ddca2d453834b0e868d6bf8c51..b1742c8a6a75e191da1a9bc28f67445e4c2c918f 100644 (file)
@@ -48,7 +48,7 @@ class SaveTag extends BaseModule
 
                $term = XML::unescape(trim($_GET['term'] ?? ''));
 
-               $item_id = static::$parameters['id'] ?? 0;
+               $item_id = $this->parameters['id'] ?? 0;
 
                $logger->info('filer', ['tag' => $term, 'item' => $item_id]);
 
index cc4041a6f0f9c1b18e4f25e03b3770844abc7075..b0456377f1c53d8ed76f29996d3b9f81300ec12d 100644 (file)
@@ -47,7 +47,7 @@ class FriendSuggest extends BaseModule
 
        public function post()
        {
-               $cid = intval(static::$parameters['contact']);
+               $cid = intval($this->parameters['contact']);
 
                // We do query the "uid" as well to ensure that it is our contact
                if (!DI::dba()->exists('contact', ['id' => $cid, 'uid' => local_user()])) {
@@ -85,7 +85,7 @@ class FriendSuggest extends BaseModule
 
        public function content(): string
        {
-               $cid = intval(static::$parameters['contact']);
+               $cid = intval($this->parameters['contact']);
 
                $contact = DI::dba()->selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
                if (empty($contact)) {
index 7dabf6c692d4dd8354daf75d4b22b41bbefae346..110371ee9595851d67cbacbaf21ed131e745213f 100644 (file)
@@ -36,12 +36,12 @@ class HCard extends BaseModule
 {
        public function content(): string
        {
-               if ((local_user()) && (static::$parameters['action'] ?? '') === 'view') {
+               if ((local_user()) && ($this->parameters['action'] ?? '') === 'view') {
                        // A logged in user views a profile of a user
                        $nickname = DI::app()->getLoggedInUserNickname();
-               } elseif (empty(static::$parameters['action'])) {
+               } elseif (empty($this->parameters['action'])) {
                        // Show the profile hCard
-                       $nickname = static::$parameters['profile'];
+                       $nickname = $this->parameters['profile'];
                } else {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('No profile'));
                }
index b92b0acf6887fc3fc621719f920189136dfba073..3936aa2bcb5730862dd5ce33d2272279b7b1a8a4 100644 (file)
@@ -44,12 +44,12 @@ class Activity extends BaseModule
                        throw new HTTPException\ForbiddenException();
                }
 
-               if (empty(static::$parameters['id']) || empty(static::$parameters['verb'])) {
+               if (empty($this->parameters['id']) || empty($this->parameters['verb'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $verb = static::$parameters['verb'];
-               $itemId =  static::$parameters['id'];
+               $verb = $this->parameters['verb'];
+               $itemId =  $this->parameters['id'];
 
                if (in_array($verb, ['announce', 'unannounce'])) {
                        $item = Post::selectFirst(['network'], ['id' => $itemId]);
index 7867b98586b2559e076af679c21f3efd7a510bf2..6521ddc91a9c4543706c81e2fe5b624d660dcdbf 100644 (file)
@@ -64,7 +64,7 @@ class Compose extends BaseModule
                }
 
                /// @TODO Retrieve parameter from router
-               $posttype = static::$parameters['type'] ?? Item::PT_ARTICLE;
+               $posttype = $this->parameters['type'] ?? Item::PT_ARTICLE;
                if (!in_array($posttype, [Item::PT_ARTICLE, Item::PT_PERSONAL_NOTE])) {
                        switch ($posttype) {
                                case 'note':
index baa99c21e052c51176d486dd16d9a44873a313a7..f893531708f5635bef6a59e732e76acb959d647f 100644 (file)
@@ -42,11 +42,11 @@ class Follow extends BaseModule
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval(static::$parameters['id']);
+               $itemId = intval($this->parameters['id']);
 
                if (!Item::performActivity($itemId, 'follow', local_user())) {
                        throw new HTTPException\BadRequestException($l10n->t('Unable to follow this item.'));
index e38dd46bc73d749adbad52020f7b7b4953a201b1..33481fd2e3d5463d3f56ced56619f9e6d107bb86 100644 (file)
@@ -41,11 +41,11 @@ class Ignore extends BaseModule
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval(static::$parameters['id']);
+               $itemId = intval($this->parameters['id']);
 
                $dba = DI::dba();
 
index 185b418bb6fdb4a972cecad27cae3c68874fea28..12ff94655346f9cb3bc352ebe596407bfe046909 100644 (file)
@@ -42,11 +42,11 @@ class Pin extends BaseModule
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval(static::$parameters['id']);
+               $itemId = intval($this->parameters['id']);
 
                $item = Post::selectFirst(['uri-id', 'uid'], ['id' => $itemId]);
                if (!DBA::isResult($item)) {
index 336207718eceb29f69e81e79c6a9664116a657d9..b3e4ed2a134e86b33530e00b09fa64b7daa2736b 100644 (file)
@@ -43,11 +43,11 @@ class Star extends BaseModule
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval(static::$parameters['id']);
+               $itemId = intval($this->parameters['id']);
 
 
                $item = Post::selectFirstForUser(local_user(), ['uid', 'uri-id', 'starred'], ['uid' => [0, local_user()], 'id' => $itemId]);
index c5a66c9bb6c972133cc9823c96c4eef80d2a386d..06bce3e2486d97bb4c43c40f0a1ea0267d236202 100644 (file)
@@ -39,10 +39,10 @@ class NoScrape extends BaseModule
        {
                $a = DI::app();
 
-               if (isset(static::$parameters['nick'])) {
+               if (isset($this->parameters['nick'])) {
                        // Get infos about a specific nick (public)
-                       $which = static::$parameters['nick'];
-               } elseif (local_user() && isset(static::$parameters['profile']) && DI::args()->get(2) == 'view') {
+                       $which = $this->parameters['nick'];
+               } elseif (local_user() && isset($this->parameters['profile']) && DI::args()->get(2) == 'view') {
                        // view infos about a known profile (needs a login)
                        $which = $a->getLoggedInUserNickname();
                } else {
index 1ceafc105b6208b3c731712a9723479d478a71bb..486054f98f2461ba40222193f4c71b1b2eaef2cc 100644 (file)
@@ -48,7 +48,7 @@ class Notification extends BaseModule
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
                }
 
-               $request_id = static::$parameters['id'] ?? false;
+               $request_id = $this->parameters['id'] ?? false;
 
                if ($request_id) {
                        $intro = DI::intro()->selectOneById($request_id, local_user());
@@ -108,7 +108,7 @@ class Notification extends BaseModule
                        return Login::form();
                }
 
-               $request_id = static::$parameters['id'] ?? false;
+               $request_id = $this->parameters['id'] ?? false;
 
                if ($request_id) {
                        $Notify = DI::notify()->selectOneById($request_id);
index bf0cc0d63e881896722e36193f483bbb5e9cab64..1f6b58e4aa5503638e060f900ce51a411ba34668 100644 (file)
@@ -17,8 +17,8 @@ class PermissionTooltip extends \Friendica\BaseModule
 {
        public function rawContent()
        {
-               $type = static::$parameters['type'];
-               $referenceId = static::$parameters['id'];
+               $type = $this->parameters['type'];
+               $referenceId = $this->parameters['id'];
 
                $expectedTypes = ['item', 'photo', 'event'];
                if (!in_array($type, $expectedTypes)) {
index 4ea3617acf65fad539270554f1b2ed9785c15436..824edeb6afadeb3b989cd4ed9b55935d92aab85a 100644 (file)
@@ -77,14 +77,14 @@ class Photo extends BaseModule
                $scale = null;
                $stamp = microtime(true);
                // User avatar
-               if (!empty(static::$parameters['type'])) {
-                       if (!empty(static::$parameters['customsize'])) {
-                               $customsize = intval(static::$parameters['customsize']);
-                               $square_resize = !in_array(static::$parameters['type'], ['media', 'preview']);
+               if (!empty($this->parameters['type'])) {
+                       if (!empty($this->parameters['customsize'])) {
+                               $customsize = intval($this->parameters['customsize']);
+                               $square_resize = !in_array($this->parameters['type'], ['media', 'preview']);
                        }
 
-                       if (!empty(static::$parameters['guid'])) {
-                               $guid = static::$parameters['guid'];
+                       if (!empty($this->parameters['guid'])) {
+                               $guid = $this->parameters['guid'];
                                $account = DBA::selectFirst('account-user-view', ['id'], ['guid' => $guid], ['order' => ['uid' => true]]);
                                if (empty($account)) {
                                        throw new HTTPException\NotFoundException();
@@ -94,12 +94,12 @@ class Photo extends BaseModule
                        }
 
                        // Contact Id Fallback, to remove after version 2021.12
-                       if (isset(static::$parameters['contact_id'])) {
-                               $id = intval(static::$parameters['contact_id']);
+                       if (isset($this->parameters['contact_id'])) {
+                               $id = intval($this->parameters['contact_id']);
                        }
 
-                       if (!empty(static::$parameters['nickname_ext'])) {
-                               $nickname = pathinfo(static::$parameters['nickname_ext'], PATHINFO_FILENAME);
+                       if (!empty($this->parameters['nickname_ext'])) {
+                               $nickname = pathinfo($this->parameters['nickname_ext'], PATHINFO_FILENAME);
                                $user = User::getByNickname($nickname, ['uid']);
                                if (empty($user)) {
                                        throw new HTTPException\NotFoundException();
@@ -109,23 +109,23 @@ class Photo extends BaseModule
                        }
 
                        // User Id Fallback, to remove after version 2021.12
-                       if (!empty(static::$parameters['uid_ext'])) {
-                               $id = intval(pathinfo(static::$parameters['uid_ext'], PATHINFO_FILENAME));
+                       if (!empty($this->parameters['uid_ext'])) {
+                               $id = intval(pathinfo($this->parameters['uid_ext'], PATHINFO_FILENAME));
                        }
 
                        // Please refactor this for the love of everything that's good
-                       if (isset(static::$parameters['id'])) {
-                               $id = static::$parameters['id'];
+                       if (isset($this->parameters['id'])) {
+                               $id = $this->parameters['id'];
                        }
 
                        if (empty($id)) {
-                               Logger::notice('No picture id was detected', ['parameters' => static::$parameters, 'query' => DI::args()->getQueryString()]);
+                               Logger::notice('No picture id was detected', ['parameters' => $this->parameters, 'query' => DI::args()->getQueryString()]);
                                throw new HTTPException\NotFoundException(DI::l10n()->t('The Photo is not available.'));
                        }
 
-                       $photo = self::getPhotoByid($id, static::$parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
+                       $photo = self::getPhotoByid($id, $this->parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
                } else {
-                       $photoid = pathinfo(static::$parameters['name'], PATHINFO_FILENAME);
+                       $photoid = pathinfo($this->parameters['name'], PATHINFO_FILENAME);
                        $scale = 0;
                        if (substr($photoid, -2, 1) == "-") {
                                $scale = intval(substr($photoid, -1, 1));
index d95f2b01ef2653647cd4fac33e0091c2a3ab1852..4a335ddf7ffaaf8d0a65dc76ba0c2587b14bde7f 100644 (file)
@@ -45,7 +45,7 @@ class Common extends BaseProfile
 
                Nav::setSelected('home');
 
-               $nickname = static::$parameters['nickname'];
+               $nickname = $this->parameters['nickname'];
 
                $profile = Profile::load($a, $nickname);
                if (empty($profile)) {
index d849d57783053566c408d61866784346021ab63d..e20fd3f2d5451d0628c7694975b3d16d6cd567be 100644 (file)
@@ -42,8 +42,8 @@ class Contacts extends Module\BaseProfile
 
                $a = DI::app();
 
-               $nickname = static::$parameters['nickname'];
-               $type = static::$parameters['type'] ?? 'all';
+               $nickname = $this->parameters['nickname'];
+               $type = $this->parameters['type'] ?? 'all';
 
                $profile = Model\Profile::load($a, $nickname);
                if (empty($profile)) {
index e6249f90e54af4fe3d56ed575efa9ec08b947ffe..75d467f547b6d4519d931f43457cfd4d2c440beb 100644 (file)
@@ -36,11 +36,11 @@ class Index extends BaseModule
 {
        public function rawContent()
        {
-               (new Profile(static::$parameters))->rawContent();
+               (new Profile($this->parameters))->rawContent();
        }
 
        public function content(): string
        {
-               return (new Status(static::$parameters))->content();
+               return (new Status($this->parameters))->content();
        }
 }
index 0f34b267deac81ed1a522c30f34ee46eedff8fcd..74af5f95e28715a0451fbfc1bec430b525b5627e 100644 (file)
@@ -33,7 +33,7 @@ class Media extends BaseProfile
        {
                $a = DI::app();
 
-               $profile = ProfileModel::load($a, static::$parameters['nickname']);
+               $profile = ProfileModel::load($a, $this->parameters['nickname']);
                if (empty($profile)) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
index 32d3aae700f09d93c1d755848b99cfff050b8fae..a497fc4dd6a721dfdf51822f2a5ea80d3a502e01 100644 (file)
@@ -49,7 +49,7 @@ class Profile extends BaseProfile
        public function rawContent()
        {
                if (ActivityPub::isRequest()) {
-                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]);
+                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname']]);
                        if (DBA::isResult($user)) {
                                try {
                                        $data = ActivityPub\Transmitter::getProfile($user['uid']);
@@ -61,9 +61,9 @@ class Profile extends BaseProfile
                                }
                        }
 
-                       if (DBA::exists('userd', ['username' => static::$parameters['nickname']])) {
+                       if (DBA::exists('userd', ['username' => $this->parameters['nickname']])) {
                                // Known deleted user
-                               $data = ActivityPub\Transmitter::getDeletedUser(static::$parameters['nickname']);
+                               $data = ActivityPub\Transmitter::getDeletedUser($this->parameters['nickname']);
 
                                System::jsonError(410, $data);
                        } else {
@@ -77,7 +77,7 @@ class Profile extends BaseProfile
        {
                $a = DI::app();
 
-               $profile = ProfileModel::load($a, static::$parameters['nickname']);
+               $profile = ProfileModel::load($a, $this->parameters['nickname']);
                if (!$profile) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('Profile not found.'));
                }
@@ -98,7 +98,7 @@ class Profile extends BaseProfile
                        DI::page()['htmlhead'] .= '<meta name="friendica.community" content="true" />' . "\n";
                }
 
-               DI::page()['htmlhead'] .= self::buildHtmlHead($profile, static::$parameters['nickname'], $remote_contact_id);
+               DI::page()['htmlhead'] .= self::buildHtmlHead($profile, $this->parameters['nickname'], $remote_contact_id);
 
                Nav::setSelected('home');
 
@@ -134,7 +134,7 @@ class Profile extends BaseProfile
                                $view_as_contact_alert = DI::l10n()->t(
                                        'You\'re currently viewing your profile as <b>%s</b> <a href="%s" class="btn btn-sm pull-right">Cancel</a>',
                                        htmlentities($view_as_contacts[$key]['name'], ENT_COMPAT, 'UTF-8'),
-                                       'profile/' . static::$parameters['nickname'] . '/profile'
+                                       'profile/' . $this->parameters['nickname'] . '/profile'
                                );
                        }
                }
index 72208fe79894397530fd50a891f33b6efb972b94..1e9cd5fa5d94fb8d866126d1720197023e575d92 100644 (file)
@@ -80,7 +80,7 @@ class Schedule extends BaseProfile
                        '$form_security_token' => BaseModule::getFormSecurityToken("profile_schedule"),
                        '$baseurl'             => DI::baseUrl()->get(true),
                        '$title'               => DI::l10n()->t('Scheduled Posts'),
-                       '$nickname'            => static::$parameters['nickname'] ?? '',
+                       '$nickname'            => $this->parameters['nickname'] ?? '',
                        '$scheduled_at'        => DI::l10n()->t('Scheduled'),
                        '$content'             => DI::l10n()->t('Content'),
                        '$delete'              => DI::l10n()->t('Remove post'),
index db5400bff17bcdfad99b6b6477cd760dd3e13c53..ad9a4acdee4f6d482d4154d1290a4d0cbec874be 100644 (file)
@@ -52,7 +52,7 @@ class Status extends BaseProfile
 
                $a = DI::app();
 
-               $profile = ProfileModel::load($a, static::$parameters['nickname']);
+               $profile = ProfileModel::load($a, $this->parameters['nickname']);
 
                if (empty($profile)) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
@@ -62,10 +62,10 @@ class Status extends BaseProfile
                        DI::page()['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
                }
 
-               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . static::$parameters['nickname'] . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
-               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/" title="' . DI::l10n()->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
-               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/comments" title="' . DI::l10n()->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
-               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
+               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . $this->parameters['nickname'] . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
+               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/" title="' . DI::l10n()->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
+               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/comments" title="' . DI::l10n()->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
+               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
 
                $category = $datequery = $datequery2 = '';
 
index 7a7c7b082b44d99469537f15706d4aeeeb2b8191..abe9a8c2e9f4ba77d1f5217a8af394d04def3777 100644 (file)
@@ -46,7 +46,7 @@ class Proxy extends BaseModule
         */
        public function rawContent()
        {
-               $request = self::getRequestInfo();
+               $request = $this->getRequestInfo();
 
                if (!DI::config()->get('system', 'proxify_content')) {
                        Logger::notice('Proxy access is forbidden', ['request' => $request, 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '', 'accept' => $_SERVER['HTTP_ACCEPT'] ?? '']);
@@ -119,13 +119,13 @@ class Proxy extends BaseModule
         *    ]
         * @throws \Exception
         */
-       private static function getRequestInfo()
+       private function getRequestInfo()
        {
                $size = ProxyUtils::PIXEL_LARGE;
                $sizetype = '';
 
-               if (!empty(static::$parameters['url']) && empty($_REQUEST['url'])) {
-                       $url = static::$parameters['url'];
+               if (!empty($this->parameters['url']) && empty($_REQUEST['url'])) {
+                       $url = $this->parameters['url'];
 
                        // thumb, small, medium and large.
                        if (substr($url, -6) == ':micro') {
index 9df9f5857b779e0971611742eeecd2b3c1cdfb69..d159255eee22d2b009704d3a1af540c61ddda2ce 100644 (file)
@@ -35,11 +35,11 @@ class PublicRSAKey extends BaseModule
 {
        public function rawContent()
        {
-               if (empty(static::$parameters['nick'])) {
+               if (empty($this->parameters['nick'])) {
                        throw new BadRequestException();
                }
 
-               $nick = static::$parameters['nick'];
+               $nick = $this->parameters['nick'];
 
                $user = User::getByNickname($nick, ['spubkey']);
                if (empty($user) || empty($user['spubkey'])) {
index 42b95e78e96a9683c1561c50a68fb31d02cf958e..fca59a2c85f14e696080404fe46452001115e026 100644 (file)
@@ -129,7 +129,7 @@ class Register extends BaseModule
 
                $tpl = $arr['template'];
 
-               $tos = new Tos(static::$parameters);
+               $tos = new Tos($this->parameters);
 
                $o = Renderer::replaceMacros($tpl, [
                        '$invitations'  => DI::config()->get('system', 'invitation_only'),
index b6b0255fcbc48eb93f1743513753b25ef61790ee..6fedc139317377b5427a554bfa752137b7eb8265 100644 (file)
@@ -44,7 +44,7 @@ class RemoteFollow extends BaseModule
 
        public function init()
        {
-               self::$owner = User::getOwnerDataByNick(static::$parameters['profile']);
+               self::$owner = User::getOwnerDataByNick($this->parameters['profile']);
                if (!self::$owner) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
@@ -115,7 +115,7 @@ class RemoteFollow extends BaseModule
                        '$submit'        => DI::l10n()->t('Submit Request'),
                        '$cancel'        => DI::l10n()->t('Cancel'),
 
-                       '$request'       => 'remote_follow/' . static::$parameters['profile'],
+                       '$request'       => 'remote_follow/' . $this->parameters['profile'],
                        '$name'          => self::$owner['name'],
                        '$myaddr'        => Profile::getMyURL(),
                ]);
index c23361cf8182a73bbc7cba168f6993ae160d1236..3b5f109d7941e889db90585a522c1491578173a0 100644 (file)
@@ -39,7 +39,7 @@ class Crop extends BaseSettings
                        return;
                }
 
-               $photo_prefix = static::$parameters['guid'];
+               $photo_prefix = $this->parameters['guid'];
                $resource_id = $photo_prefix;
                $scale = 0;
                if (substr($photo_prefix, -2, 1) == '-') {
@@ -168,7 +168,7 @@ class Crop extends BaseSettings
 
                parent::content();
 
-               $resource_id = static::$parameters['guid'];
+               $resource_id = $this->parameters['guid'];
 
                $photos = Photo::selectToArray([], ['resource-id' => $resource_id, 'uid' => local_user()], ['order' => ['scale' => false]]);
                if (!DBA::isResult($photos)) {
index cd393d641de7c5f56a32cac26236c7e8ae4441b0..6c164b5ba5e26f11fdd20e4fba40fe162dc5e327 100644 (file)
@@ -34,7 +34,7 @@ class Theme extends BaseModule
        {
                header('Content-Type: text/css');
 
-               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
 
                if (file_exists("view/theme/$theme/theme.php")) {
                        require_once "view/theme/$theme/theme.php";
index f42274953d83e93cd228153e5df6c8360eb53302..07ed5a610fe380a4861e4be27aadaaf2273b9c9b 100644 (file)
@@ -35,7 +35,7 @@ class Community extends CommunityModule
 {
        public function rawContent()
        {
-               self::parseRequest();
+               $this->parseRequest();
 
                $o = '';
                if (!empty($_GET['force']) || !DI::pConfig()->get(local_user(), 'system', 'no_auto_update')) {
index a1a120ea27dce40c5fcce6c76d3f69ba187f269c..3652b1126330ff22bd621d0438d62c220dd33ac8 100644 (file)
@@ -15,7 +15,7 @@ class Network extends NetworkModule
                        exit();
                }
 
-               self::parseRequest($_GET);
+               $this->parseRequest($_GET);
 
                $profile_uid = intval($_GET['p']);