From c5a52271dfb96be7b837b1a2ef7ff7d41dfbd698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 3 Jul 2023 14:56:08 +0200 Subject: [PATCH 1/2] Added: - config key 'config', 'api_mastodon_banner', see discussion at https://b65.me.in/display/67fef576-1564-a27a-405e-c17705255720 - the administrator can now customize it for Mastodon contacts - credits goes to @betamax65@b65.me.in --- src/Object/Api/Mastodon/Instance.php | 2 +- static/defaults.config.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Object/Api/Mastodon/Instance.php b/src/Object/Api/Mastodon/Instance.php index 118d491fc..7201e530c 100644 --- a/src/Object/Api/Mastodon/Instance.php +++ b/src/Object/Api/Mastodon/Instance.php @@ -91,7 +91,7 @@ class Instance extends BaseDataTransferObject $this->version = '2.8.0 (compatible; Friendica ' . App::VERSION . ')'; $this->urls = null; // Not supported $this->stats = new Stats($config, $database); - $this->thumbnail = $baseUrl . '/images/friendica-banner.jpg'; + $this->thumbnail = $baseUrl . $config->get('config', 'api_mastodon_banner'); $this->languages = [$config->get('system', 'language')]; $this->max_toot_chars = (int)$config->get('config', 'api_import_size', $config->get('config', 'max_import_size')); $this->registrations = ($register_policy != Register::CLOSED); diff --git a/static/defaults.config.php b/static/defaults.config.php index 273095315..197d06290 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -91,6 +91,10 @@ return [ // php_path (String) // Location of PHP command line processor. 'php_path' => 'php', + + // api_mastodon_banner (String) + // Banner for Mastodon API + 'api_mastodon_banner' => '/images/friendica-banner.jpg', ], 'system' => [ // adjust_poll_frequency (Boolean) From 9f1c93eb91201d4be1ef4692c4bccdb515015866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 3 Jul 2023 19:54:41 +0200 Subject: [PATCH 2/2] Changes: - renamed 'api_mastodon_banner' to 'mastodon_banner' and moved it to 'api' configuration group --- src/Object/Api/Mastodon/Instance.php | 2 +- static/defaults.config.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Object/Api/Mastodon/Instance.php b/src/Object/Api/Mastodon/Instance.php index 7201e530c..e19f6ba13 100644 --- a/src/Object/Api/Mastodon/Instance.php +++ b/src/Object/Api/Mastodon/Instance.php @@ -91,7 +91,7 @@ class Instance extends BaseDataTransferObject $this->version = '2.8.0 (compatible; Friendica ' . App::VERSION . ')'; $this->urls = null; // Not supported $this->stats = new Stats($config, $database); - $this->thumbnail = $baseUrl . $config->get('config', 'api_mastodon_banner'); + $this->thumbnail = $baseUrl . $config->get('api', 'mastodon_banner'); $this->languages = [$config->get('system', 'language')]; $this->max_toot_chars = (int)$config->get('config', 'api_import_size', $config->get('config', 'max_import_size')); $this->registrations = ($register_policy != Register::CLOSED); diff --git a/static/defaults.config.php b/static/defaults.config.php index 197d06290..e8f44613c 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -91,10 +91,6 @@ return [ // php_path (String) // Location of PHP command line processor. 'php_path' => 'php', - - // api_mastodon_banner (String) - // Banner for Mastodon API - 'api_mastodon_banner' => '/images/friendica-banner.jpg', ], 'system' => [ // adjust_poll_frequency (Boolean) @@ -785,4 +781,9 @@ return [ // By default the template cache is stored in several subdirectories. 'use_sub_dirs' => true, ], + 'api' => [ + // mastodon_banner (String) + // Banner for Mastodon API + 'mastodon_banner' => '/images/friendica-banner.jpg', + ], ];