From 5199a887080221c0b0d4945eb8eb0b82f35a3637 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 15:53:09 +0200 Subject: [PATCH 1/4] [nitter] add note about privacy protection to the replacement message --- nitter/nitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nitter/nitter.php b/nitter/nitter.php index 28bd98576..538de2c34 100644 --- a/nitter/nitter.php +++ b/nitter/nitter.php @@ -72,6 +72,6 @@ function nitter_render(&$a, &$o) $replaced = true; } if ($replaced) { - $o['html'] .= '

' . DI::l10n()->t('Links to Twitter in this posting were replaced by links to the Nitter instance at %s', $nitter) . '

'; + $o['html'] .= '

' . DI::l10n()->t('In an attempt to protect your privacy, links to Twitter in this posting were replaced by links to the Nitter instance at %s', $nitter) . '

'; } } From d893ea016dad08b57f2559223aa4dc919d14687f Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 16:10:51 +0200 Subject: [PATCH 2/4] [nitter] renew the messages.po file --- nitter/lang/C/messages.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nitter/lang/C/messages.po b/nitter/lang/C/messages.po index a9e2428ad..984707cc8 100644 --- a/nitter/lang/C/messages.po +++ b/nitter/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-08 07:44+0100\n" +"POT-Creation-Date: 2021-10-01 16:10+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: nitter.php:51 +#: nitter.php:52 #, php-format msgid "" "Which nitter server shall be used for the replacements in the post bodies? " @@ -25,17 +25,17 @@ msgid "" "public Nitter servers." msgstr "" -#: nitter.php:52 +#: nitter.php:53 msgid "Nitter server" msgstr "" -#: nitter.php:53 +#: nitter.php:54 msgid "Save Settings" msgstr "" -#: nitter.php:65 +#: nitter.php:99 #, php-format msgid "" -"Links to Twitter in this posting were replaced by links to the Nitter " -"instance at %s" +"In an attempt to protect your privacy, links to Twitter in this posting were " +"replaced by links to the Nitter instance at %s" msgstr "" From 1ec669ce9a2840197122bac5a9cbdde6805eac53 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 17:04:33 +0200 Subject: [PATCH 3/4] [nitter] use other hook for the addon This enables the addon to also replace links in the attached preview with the Nitter server. **BUT** it requires the addon to be reloaded manually by the nodes admin. --- nitter/nitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nitter/nitter.php b/nitter/nitter.php index 538de2c34..687ea78c4 100644 --- a/nitter/nitter.php +++ b/nitter/nitter.php @@ -30,7 +30,7 @@ use Friendica\DI; function nitter_install() { - Addon::registerHook ('prepare_body', 'addon/nitter/nitter.php', 'nitter_render'); + Addon::registerHook ('prepare_body_final', 'addon/nitter/nitter.php', 'nitter_render'); } /* Handle the send data from the admin settings From 8c5125c3f1819779687d154929fc245647f89c0d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 17:08:38 +0200 Subject: [PATCH 4/4] [nitter] update README, bump version number As the changed hook is a breaking change, the version of the addon is raised to 2.0. --- nitter/nitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nitter/nitter.php b/nitter/nitter.php index 687ea78c4..49808a126 100644 --- a/nitter/nitter.php +++ b/nitter/nitter.php @@ -2,7 +2,7 @@ /* * Name: nitter * Description: Replaces links to twitter.com to a nitter server in all displays of postings on a node. - * Version: 1.1 + * Version: 2.0 * Author: Tobias Diekershoff * * Copyright (c) 2020 Tobias Diekershoff