]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Mastodon/Accounts.php
Merge pull request #11129 from urbalazs/copyright-2022
[friendica.git] / src / Module / Api / Mastodon / Accounts.php
index 360993397ac0aaf9c96f490f99b0a0603fb0345b..69168390e24270bef68668b40c7da08a0c3ccff6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -35,24 +35,24 @@ class Accounts extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent()
+       protected function rawContent(array $request = [])
        {
                $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();
                        }
                }