Setting for preferred web front end added

This commit is contained in:
Michael 2026-03-18 13:21:21 +00:00
commit 3d199ba7d7
3 changed files with 50 additions and 27 deletions

View file

@ -267,6 +267,7 @@ function bluesky_settings(array &$data)
$def_enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default') ?? false;
$pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds');
$handle = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle');
$web = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'web');
$did = DI::atProtocol()->getUserDid(DI::userSession()->getLocalUserId());
$token = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'access_token');
$import = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'import') ?? false;
@ -285,6 +286,13 @@ function bluesky_settings(array &$data)
$friendica_handle = [];
}
$web_frontend = [
'' => 'System Default',
ATProtocol::WEB => 'Bluesky',
'https://blacksky.community' => 'Blacksky',
'https://reddwarf.app' => 'Red Dwarf',
];
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/bluesky/');
$html = Renderer::replaceMacros($t, [
'$enable' => ['bluesky', DI::l10n()->t('Enable AT Protocol Addon'), $enabled],
@ -297,6 +305,7 @@ function bluesky_settings(array &$data)
'$handle' => ['bluesky_handle', DI::l10n()->t('AT Protocol handle'), $handle, '', '', $custom_handle ? 'readonly' : ''],
'$did' => ['bluesky_did', DI::l10n()->t('AT Protocol DID'), $did, DI::l10n()->t('This is the unique identifier. It will be fetched automatically, when the handle is entered.'), '', 'readonly'],
'$password' => ['bluesky_password', DI::l10n()->t('AT Protocol app password'), '', DI::l10n()->t("Please don't add your real password here, but instead create a specific app password in the settings of your AT Protocol system.")],
'$web' => ['bluesky_web', DI::l10n()->t('Web front end'), $web, DI::l10n()->t('Choose your preferred external web front end for displaying posts and profiles.'), $web_frontend, ''],
'$status' => bluesky_get_status($handle, $did, $pds, $token),
]);
@ -370,6 +379,11 @@ function bluesky_settings_post(array &$b)
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'import_feeds', intval($_POST['bluesky_import_feeds']));
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'complete_threads', intval($_POST['bluesky_complete_threads']));
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'friendica_handle', intval($_POST['bluesky_friendica_handle'] ?? false));
if ($_POST['bluesky_web'] <> '') {
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'web', $_POST['bluesky_web']);
} else {
DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'web');
}
if (!empty($handle)) {
$did = DI::atProtocol()->getUserDid(DI::userSession()->getLocalUserId(), empty($old_did) || $old_handle != $handle);

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-03-15 23:16+0000\n"
"POT-Creation-Date: 2026-03-18 13:20+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -30,105 +30,113 @@ msgstr ""
msgid "Before enabling this option, you have to setup a wildcard domain configuration and you have to enable wildcard requests in your webserver configuration. On Apache this is done by adding \"ServerAlias *.%s\" to your HTTP configuration. You don't need to change the HTTPS configuration."
msgstr ""
#: bluesky.php:280
#: bluesky.php:281
#, php-format
msgid "Allow to use %s as your AT Protocol handle."
msgstr ""
#: bluesky.php:280
#: bluesky.php:281
#, php-format
msgid "When enabled, you can use %s as your AT Protocol handle. After you enabled this option, please go to https://bsky.app/settings and select to change your handle. Select that you have got your own domain. Then enter %s and select \"No DNS Panel\". Then select \"Verify Text File\"."
msgstr ""
#: bluesky.php:290
#: bluesky.php:298
msgid "Enable AT Protocol Addon"
msgstr ""
#: bluesky.php:291
#: bluesky.php:299
msgid "Post via AT Protocol by default"
msgstr ""
#: bluesky.php:292
#: bluesky.php:300
msgid "Import the remote timeline"
msgstr ""
#: bluesky.php:293
#: bluesky.php:301
msgid "Import the pinned feeds"
msgstr ""
#: bluesky.php:293
#: bluesky.php:301
msgid "When activated, Posts will be imported from all the feeds that you pinned in AT Protocol."
msgstr ""
#: bluesky.php:294
#: bluesky.php:302
msgid "Complete the threads"
msgstr ""
#: bluesky.php:294
#: bluesky.php:302
msgid "When activated, the system fetches additional replies for the posts in the timeline. This leads to more complete threads."
msgstr ""
#: bluesky.php:296
#: bluesky.php:304
msgid "Personal Data Server"
msgstr ""
#: bluesky.php:296
#: bluesky.php:304
msgid "The personal data server (PDS) is the system that hosts your profile."
msgstr ""
#: bluesky.php:297
#: bluesky.php:305
msgid "AT Protocol handle"
msgstr ""
#: bluesky.php:298
#: bluesky.php:306
msgid "AT Protocol DID"
msgstr ""
#: bluesky.php:298
#: bluesky.php:306
msgid "This is the unique identifier. It will be fetched automatically, when the handle is entered."
msgstr ""
#: bluesky.php:299
#: bluesky.php:307
msgid "AT Protocol app password"
msgstr ""
#: bluesky.php:299
#: bluesky.php:307
msgid "Please don't add your real password here, but instead create a specific app password in the settings of your AT Protocol system."
msgstr ""
#: bluesky.php:305
#: bluesky.php:308
msgid "Web front end"
msgstr ""
#: bluesky.php:308
msgid "Choose your preferred external web front end for displaying posts and profiles."
msgstr ""
#: bluesky.php:314
msgid "AT Protocol (Bluesky, Eurosky, Blacksky, ...) Import/Export"
msgstr ""
#: bluesky.php:315
#: bluesky.php:324
msgid "You are not authenticated. Please enter your handle and the app password."
msgstr ""
#: bluesky.php:336
#: bluesky.php:345
msgid "You are authenticated to the AT Protocol PDS. For security reasons the password isn't stored."
msgstr ""
#: bluesky.php:338
#: bluesky.php:347
msgid "The communication with the personal data server service (PDS) is established."
msgstr ""
#: bluesky.php:340
#: bluesky.php:349
#, php-format
msgid "Communication issues with the personal data server service (PDS): %s"
msgstr ""
#: bluesky.php:342
#: bluesky.php:351
msgid "The DID for the provided handle could not be detected. Please check if you entered the correct handle."
msgstr ""
#: bluesky.php:344
#: bluesky.php:353
msgid "The personal data server service (PDS) could not be detected."
msgstr ""
#: bluesky.php:346
#: bluesky.php:355
msgid "The authentication with the provided handle and password failed. Please check if you entered the correct password."
msgstr ""
#: bluesky.php:411
#: bluesky.php:425
msgid "Post via the AT Protocol"
msgstr ""

View file

@ -10,4 +10,5 @@
{{include file="field_input.tpl" field=$pds}}
{{include file="field_input.tpl" field=$handle}}
{{include file="field_input.tpl" field=$did}}
{{include file="field_input.tpl" field=$password}}
{{include file="field_input.tpl" field=$password}}
{{include file="field_select.tpl" field=$web}}