]> git.mxchange.org Git - friendica.git/commitdiff
API: Some more apps are now supported
authorMichael <heluecht@pirati.ca>
Thu, 10 Jun 2021 19:10:33 +0000 (19:10 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 10 Jun 2021 19:10:33 +0000 (19:10 +0000)
doc/API-Mastodon.md
src/Object/Api/Mastodon/Conversation.php
src/Object/Api/Mastodon/Instance.php
src/Object/Api/Mastodon/Mention.php
src/Object/Api/Mastodon/Relationship.php

index d453883b0eaae2e04e920c16183a6f9c89100a70..d76b751a0f4f8a5cd7eae2d4830be861937c9095 100644 (file)
@@ -17,6 +17,7 @@ Authentication is the same as described in [Using the APIs](help/api#Authenticat
 
 - [AndStatus](http://andstatus.org)
 - [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma)
+- [Fedi](https://play.google.com/store/apps/details?id=com.fediverse.app)
 - [Husky](https://husky.fwgs.ru)
 - [Roma](https://play.google.com/store/apps/details?id=tech.bigfig.roma)
 - [Subway Tooter](https://github.com/tateisu/SubwayTooter)
@@ -28,27 +29,26 @@ Authentication is the same as described in [Using the APIs](help/api#Authenticat
 #### iOS
 - [Amaroq](https://github.com/ReticentJohn/Amaroq/tree/master)
 - [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma)
+- [Fedi](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281)
+- [Roma](https://apps.apple.com/de/app/roma-for-pleroma-and-mastodon/id1445328699)
 - [StarPterano](https://apps.apple.com/de/app/starpterano/id1436972796) Uses an OAuth method where you have to manually copy and paste the provided code.
 - [Stella](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048?l=ms)
+- [Tootle](https://apps.apple.com/de/app/tootle-for-mastodon/id1236013466) entered hostname must match in upper/lower case. Currently crashes on "Status" type notifications.
 
 ### Unsupported apps
 
 #### Android
-- [Fedi](https://play.google.com/store/apps/details?id=com.fediverse.app) Authenticates, but doesn't load posts and throws several errors
 - [Fedilab](https://framagit.org/tom79/fedilab) Automatically uses the legacy API, see issue: https://framagit.org/tom79/fedilab/-/issues/520
 - [Mammut](https://github.com/jamiesanson/Mammut) There are problems with the token request, see issue https://github.com/jamiesanson/Mammut/issues/19
 
 #### iOS
-- [Fedi](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281) Authenticates, but doesn't load posts and throws several errors
 - [Mast](https://github.com/Beesitech/Mast) Doesn't accept the entered instance name. Claims that it is invalid (Message is: "Not a valid instance (may be closed or dead)")
-- [Mastonaut](https://mastonaut.app/)
-- [Roma](https://apps.apple.com/de/app/roma-for-pleroma-and-mastodon/id1445328699) Authenticates, but doesn't load content
 - [Toot!](https://apps.apple.com/app/toot/id1229021451)
-- [Tootle](https://apps.apple.com/de/app/tootle-for-mastodon/id1236013466) Doesn't recognize server, loads /api/v1/instance in some endless loop
 
 #### Other
 
 - [Halycon](https://www.halcyon.social/) Doesn't load content, creates masses of HTTP requests
+- [Mastonaut](https://mastonaut.app/)
 - [Pinafore](https://github.com/nolanlawson/pinafore) Returns message "Error: NetworkError when attempting to fetch resource.. Is this a valid Mastodon instance?"
 
 ## Entities
index 0b0136044f2302145b91e94999b3d98fefc3d3f9..e0950e555e7a72acacc8e20c3eedef2015275b82 100644 (file)
@@ -46,7 +46,7 @@ class Conversation extends BaseDataTransferObject
 
        public function __construct(string $id, array $accounts, bool $unread, \Friendica\Object\Api\Mastodon\Status $last_status)
        {
-               $this->id          = $id;
+               $this->id          = (string)$id;
                $this->accounts    = $accounts;
                $this->unread      = $unread;
                $this->last_status = $last_status;
index 031e5bcb06446cd1ee4fa4e50f38b5db0af1f198..82f30390d7a4193c42c3c36ac592f09982c621f3 100644 (file)
@@ -39,6 +39,8 @@ class Instance extends BaseDataTransferObject
        /** @var string */
        protected $title;
        /** @var string */
+       protected $short_description;
+       /** @var string */
        protected $description;
        /** @var string */
        protected $email;
@@ -58,8 +60,12 @@ class Instance extends BaseDataTransferObject
        protected $registrations;
        /** @var bool */
        protected $approval_required;
+       /** @var bool */
+       protected $invites_enabled;
        /** @var Account|null */
        protected $contact_account = null;
+       /** @var array */
+       protected $rules = [];
 
        /**
         * Creates an instance record
@@ -77,7 +83,7 @@ class Instance extends BaseDataTransferObject
                $instance = new Instance();
                $instance->uri = $baseUrl->get();
                $instance->title = DI::config()->get('config', 'sitename');
-               $instance->description = DI::config()->get('config', 'info');
+               $instance->short_description = $instance->description = DI::config()->get('config', 'info');
                $instance->email = DI::config()->get('config', 'admin_email');
                $instance->version = FRIENDICA_VERSION;
                $instance->urls = null; // Not supported
@@ -87,6 +93,7 @@ class Instance extends BaseDataTransferObject
                $instance->max_toot_chars = (int)DI::config()->get('config', 'api_import_size', DI::config()->get('config', 'max_import_size'));
                $instance->registrations = ($register_policy != Register::CLOSED);
                $instance->approval_required = ($register_policy == Register::APPROVE);
+               $instance->invites_enabled = false;
                $instance->contact_account = [];
 
                if (!empty(DI::config()->get('config', 'admin_email'))) {
index d64fe6b5fc829255b19878b0f6ea602f1dc67529..3fd2507c4a743bfa1423c11f99f5961186033320 100644 (file)
@@ -50,7 +50,7 @@ class Mention extends BaseDataTransferObject
         */
        public function __construct(BaseURL $baseUrl, array $tag, array $contact)
        {
-               $this->id       = $contact['id'] ?? 0;
+               $this->id       = (string)($contact['id'] ?? 0);
                $this->username = $tag['name'];
                $this->url      = $tag['url'];
 
@@ -59,6 +59,8 @@ class Mention extends BaseDataTransferObject
                                strpos($contact['url'], $baseUrl->get() . '/') === 0 ?
                                        $contact['nick'] :
                                        $contact['addr'];
+
+                       $this->username = $contact['nick'];
                } else {
                        $this->acct = '';
                }
index 870acb54466178407f8fc9747df59de963cd41de..5d7169b8934d12a4c8bd7ab3ef7d2a87ff13596e 100644 (file)
@@ -79,7 +79,7 @@ class Relationship extends BaseDataTransferObject
         */
        public function __construct(int $contactId, array $contactRecord = [], bool $blocked = false, bool $muted = false)
        {
-               $this->id                   = $contactId;
+               $this->id                   = (string)$contactId;
                $this->following            = false;
                $this->requested            = false;
                $this->endorsed             = false;