Added some more data
parent
1958bde4c0
commit
4e2804d783
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon;
|
namespace Friendica\Module\Api\Mastodon;
|
||||||
|
|
||||||
|
use Friendica\Api\Mastodon\Account;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
|
@ -35,7 +36,6 @@ class Instance extends Api
|
||||||
$return = [
|
$return = [
|
||||||
'uri' => $app->getBaseURL(),
|
'uri' => $app->getBaseURL(),
|
||||||
'title' => Config::get('config', 'sitename'),
|
'title' => Config::get('config', 'sitename'),
|
||||||
'short_description' => '', // Not supported
|
|
||||||
'description' => Config::get('config', 'info'),
|
'description' => Config::get('config', 'info'),
|
||||||
'email' => Config::get('config', 'admin_email'),
|
'email' => Config::get('config', 'admin_email'),
|
||||||
'version' => FRIENDICA_VERSION,
|
'version' => FRIENDICA_VERSION,
|
||||||
|
@ -43,11 +43,16 @@ class Instance extends Api
|
||||||
'stats' => [],
|
'stats' => [],
|
||||||
'thumbnail' => $app->getBaseURL() . (Config::get('system', 'shortcut_icon') ?? 'images/friendica-32.png'),
|
'thumbnail' => $app->getBaseURL() . (Config::get('system', 'shortcut_icon') ?? 'images/friendica-32.png'),
|
||||||
'languages' => [Config::get('system', 'language')],
|
'languages' => [Config::get('system', 'language')],
|
||||||
|
'max_toot_chars' => (int)Config::get('config', 'api_import_size', Config::get('config', 'max_import_size')),
|
||||||
'registrations' => ($register_policy != Register::CLOSED),
|
'registrations' => ($register_policy != Register::CLOSED),
|
||||||
'approval_required' => ($register_policy == Register::APPROVE),
|
'approval_required' => ($register_policy == Register::APPROVE),
|
||||||
'contact_account' => [] // Currently unsupported
|
'contact_account' => []
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (!$return['registrations']) {
|
||||||
|
unset($return['approval_required']);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty(Config::get('system', 'nodeinfo'))) {
|
if (!empty(Config::get('system', 'nodeinfo'))) {
|
||||||
$count = DBA::count('gserver', ["`network` in (?, ?) AND `last_contact` >= `last_failure`", Protocol::DFRN, Protocol::ACTIVITYPUB]);
|
$count = DBA::count('gserver', ["`network` in (?, ?) AND `last_contact` >= `last_failure`", Protocol::DFRN, Protocol::ACTIVITYPUB]);
|
||||||
$return['stats'] = [
|
$return['stats'] = [
|
||||||
|
@ -57,17 +62,14 @@ class Instance extends Api
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @ToDo will be done, once that we have an API function for that
|
|
||||||
/*
|
|
||||||
if (!empty(Config::get('config', 'admin_email'))) {
|
if (!empty(Config::get('config', 'admin_email'))) {
|
||||||
$adminList = explode(',', str_replace(' ', '', Config::get('config', 'admin_email')));
|
$adminList = explode(',', str_replace(' ', '', Config::get('config', 'admin_email')));
|
||||||
$administrator = User::getByEmail($adminList[0], ['nickname']);
|
$administrator = User::getByEmail($adminList[0], ['nickname']);
|
||||||
if (!empty($administrator)) {
|
if (!empty($administrator)) {
|
||||||
$adminContact = DBA::selectFirst('contact', [], ['nick' => $administrator['nickname'], 'self' => true]);
|
$adminContact = DBA::selectFirst('contact', [], ['nick' => $administrator['nickname'], 'self' => true]);
|
||||||
$return['contact_account'] = Api::getAccountArray($adminContact);
|
$return['contact_account'] = Account::createFromContact($adminContact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
System::jsonExit($return);
|
System::jsonExit($return);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue