API: Some more apps are now supported

This commit is contained in:
Michael 2021-06-10 19:10:33 +00:00
parent 328788abe9
commit 945f482ba3
5 changed files with 18 additions and 9 deletions

View 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

View 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;

View 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'))) {

View 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 = '';
}

View 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;