From 1c745a3d3ae3cb430f9d95e299f19f0a0fb20cf7 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 20 May 2021 08:41:01 -0400 Subject: [PATCH 01/15] [showmore] Add RTL support to showmore created div --- showmore/showmore.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/showmore/showmore.php b/showmore/showmore.php index c0f581ec..dd6d4773 100644 --- a/showmore/showmore.php +++ b/showmore/showmore.php @@ -125,9 +125,9 @@ function showmore_prepare_body(\Friendica\App $a, &$hook_data) if ($found) { $rnd = Strings::getRandomHex(8); - $hook_data['html'] = '' . - ''; + $hook_data['html'] = '' . + ''; } } -- 2.43.5 From d5c7dd80aa20e1cf232b4ab7109145215b170693 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 21 May 2021 07:58:24 +0200 Subject: [PATCH 02/15] [keycloakpassword] added base messages.po file for translations --- keycloakpassword/lang/C/messages.po | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 keycloakpassword/lang/C/messages.po diff --git a/keycloakpassword/lang/C/messages.po b/keycloakpassword/lang/C/messages.po new file mode 100644 index 00000000..0dd6887b --- /dev/null +++ b/keycloakpassword/lang/C/messages.po @@ -0,0 +1,51 @@ +# ADDON keycloakpassword +# Copyright (C) +# This file is distributed under the same license as the Friendica keycloakpassword addon package. +# +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-05-21 07:56+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: keycloakpassword.php:118 +msgid "Client ID" +msgstr "" + +#: keycloakpassword.php:119 +msgid "" +"The name of the OpenID Connect client you created for this addon in Keycloak." +msgstr "" + +#: keycloakpassword.php:123 +msgid "Client secret" +msgstr "" + +#: keycloakpassword.php:124 +msgid "" +"The secret assigned to the OpenID Connect client you created for this addon " +"in Keycloak." +msgstr "" + +#: keycloakpassword.php:128 +msgid "OpenID Connect endpoint" +msgstr "" + +#: keycloakpassword.php:130 +msgid "" +"URL to the Keycloak endpoint for your client. (E.g., https://example.com/" +"auth/realms/some-realm/protocol/openid-connect)" +msgstr "" + +#: keycloakpassword.php:136 +msgid "Save Settings" +msgstr "" -- 2.43.5 From 87a3a0589a86ca56593f50c6199ff74e7a63ac85 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 21 May 2021 10:11:11 +0200 Subject: [PATCH 03/15] nitter addon added Treansfering the addon from the separate repository into the projects addon collection. This addon is meant to replace links to Twitter in the body of postings with a nitter [1] instance of the admins choice. It is not meant to change links to contact prociles. In addition to the change, a note about the changed links is placed at the bottom of the posting. 1: https://github.com/zedeus/nitter --- nitter/LICENSE | 7 ++++ nitter/README.md | 27 +++++++++++++++ nitter/lang/C/messages.po | 41 +++++++++++++++++++++++ nitter/lang/de/messages.po | 41 +++++++++++++++++++++++ nitter/lang/de/strings.php | 7 ++++ nitter/nitter.php | 67 ++++++++++++++++++++++++++++++++++++++ nitter/templates/admin.tpl | 5 +++ 7 files changed, 195 insertions(+) create mode 100644 nitter/LICENSE create mode 100644 nitter/README.md create mode 100644 nitter/lang/C/messages.po create mode 100644 nitter/lang/de/messages.po create mode 100644 nitter/lang/de/strings.php create mode 100644 nitter/nitter.php create mode 100644 nitter/templates/admin.tpl diff --git a/nitter/LICENSE b/nitter/LICENSE new file mode 100644 index 00000000..69d75892 --- /dev/null +++ b/nitter/LICENSE @@ -0,0 +1,7 @@ +Copyright 2020 Tobias Diekershoff + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/nitter/README.md b/nitter/README.md new file mode 100644 index 00000000..8fab6304 --- /dev/null +++ b/nitter/README.md @@ -0,0 +1,27 @@ +nitter Addon for Friendica +========================== + +This addon will replace all occurances of the string _https://twitter.com_ with the server address of a nitter installation in all displayed postings on a Friendica node. + +Note: If you are using the twitter connector on your server, the links to the contacts profile pages will not be replaced by this addon. Only links in the body of the postings are affected. + +Nitter sources can be found on [github.com](https://github.com/zedeus/nitter) it is released unter the AGPLv3 or later. + +Why +--- + +Excerp from nitters about page. + +> It's basically impossible to use Twitter without JavaScript enabled. If you try, you're redirected to the legacy mobile version which is awful both functionally and aesthetically. For privacy-minded folks, preventing JavaScript analytics and potential IP-based tracking is important, but apart from using the legacy mobile version and a VPN, it's impossible. +> +> Using an instance of Nitter (hosted on a VPS for example), you can browse Twitter without JavaScript while retaining your privacy. In addition to respecting your privacy, Nitter is on average around 15 times lighter than Twitter, and in some cases serves pages faster. +> +> In the future a simple account system will be added that lets you follow Twitter users, allowing you to have a clean chronological timeline without needing a Twitter account. + +Changelog +--------- + +* **Version 1.1** + * Initial localization support with DE translation + * Configurable nitter instance address from the admin panel +* **Version 1.0**: Initial Release diff --git a/nitter/lang/C/messages.po b/nitter/lang/C/messages.po new file mode 100644 index 00000000..a9e2428a --- /dev/null +++ b/nitter/lang/C/messages.po @@ -0,0 +1,41 @@ +# ADDON nitter +# Copyright (C) +# This file is distributed under the same license as the Friendica nitter addon package. +# +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-03-08 07:44+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: nitter.php:51 +#, php-format +msgid "" +"Which nitter server shall be used for the replacements in the post bodies? " +"Use the URL with servername and protocol. See %s for a list of available " +"public Nitter servers." +msgstr "" + +#: nitter.php:52 +msgid "Nitter server" +msgstr "" + +#: nitter.php:53 +msgid "Save Settings" +msgstr "" + +#: nitter.php:65 +#, php-format +msgid "" +"Links to Twitter in this posting were replaced by links to the Nitter " +"instance at %s" +msgstr "" diff --git a/nitter/lang/de/messages.po b/nitter/lang/de/messages.po new file mode 100644 index 00000000..fb3825f5 --- /dev/null +++ b/nitter/lang/de/messages.po @@ -0,0 +1,41 @@ +# ADDON nitter +# Copyright (C) +# This file is distributed under the same license as the Friendica nitter addon package. +# +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-03-08 07:44+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: nitter.php:51 +#, php-format +msgid "" +"Which nitter server shall be used for the replacements in the post bodies? " +"Use the URL with servername and protocol. See %s for a list of available " +"public Nitter servers." +msgstr "Welcher Nitter server soll für die Ersetzungen verwendet werden? Gib die URL mit Servername und Protokoll an. Eine Liste von öffentlichen Nitter servern findest du unter %s." + +#: nitter.php:52 +msgid "Nitter server" +msgstr "Nitter Server" + +#: nitter.php:53 +msgid "Save Settings" +msgstr "Einstellungen Speichern" + +#: nitter.php:65 +#, php-format +msgid "" +"Links to Twitter in this posting were replaced by links to the Nitter " +"instance at %s" +msgstr "In diesem Beitrag wurden Links nach twitter.com durch die Nitter Instanz auf %s ersetzt." diff --git a/nitter/lang/de/strings.php b/nitter/lang/de/strings.php new file mode 100644 index 00000000..33a0ed2e --- /dev/null +++ b/nitter/lang/de/strings.php @@ -0,0 +1,7 @@ +strings["Which nitter server shall be used for the replacements in the post bodies? Use the URL with servername and protocol. See %s for a list of available public Nitter servers."] = "Welcher Nitter server soll für die Ersetzungen verwendet werden? Gib die URL mit Servername und Protokoll an. Eine Liste von öffentlichen Nitter servern findest du unter %s."; +$a->strings["Nitter server"] = "Nitter Server"; +$a->strings["Save Settings"] = "Einstellungen Speichern"; +$a->strings["Links to Twitter in this posting were replaced by links to the Nitter instance at %s"] = "In diesem Beitrag wurden Links nach twitter.com durch die Nitter Instanz auf %s ersetzt."; diff --git a/nitter/nitter.php b/nitter/nitter.php new file mode 100644 index 00000000..b6630b7c --- /dev/null +++ b/nitter/nitter.php @@ -0,0 +1,67 @@ + + * + * Copyright (c) 2020 Tobias Diekershoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * associated documentation files (the "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +use Friendica\App; +use Friendica\Core\Addon; +use Friendica\Core\Renderer; +use Friendica\DI; + +function nitter_install() { + Addon::registerHook ('prepare_body', 'addon/nitter/nitter.php', 'nitter_render'); +} + +/* Handle the send data from the admin settings + */ +function nitter_addon_admin_post(App $a) +{ + $nitterserver = trim($_POST['nitterserver']); + DI::config()->set('nitter', 'server', $nitterserver); +} + +/* Hook into the admin settings to let the admin choose a + * nitter server to use for the replacement. + */ +function nitter_addon_admin(App $a, &$o) +{ + $nitterserver = DI::config()->get('nitter', 'server'); + $t = Renderer::getMarkupTemplate("admin.tpl", "addon/nitter/"); + $o = Renderer::replaceMacros($t, [ + '$settingdescription' => DI::l10n()->t('Which nitter server shall be used for the replacements in the post bodies? Use the URL with servername and protocol. See %s for a list of available public Nitter servers.', "https://github.com/zedeus/nitter/wiki/Instances"), + '$nitterserver' => ["nitterserver", DI::l10n()->t('Nitter server'), $nitterserver, 'http://example.com'], + '$submit' => DI::l10n()->t('Save Settings'), + ]); +} + +/* + * replace "twitter.com" with "nitter.net" + */ +function nitter_render(&$a, &$o) { + // this needs to be a system setting + $nitter = DI::config()->get('nitter', 'server', 'https://nitter.net'); + if (strstr($o['html'],'https://twitter.com')) { + $o['html'] = str_replace('https://twitter.com', $nitter, $o['html']); + $o['html'] .= '

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

'; + } +} diff --git a/nitter/templates/admin.tpl b/nitter/templates/admin.tpl new file mode 100644 index 00000000..b7f02421 --- /dev/null +++ b/nitter/templates/admin.tpl @@ -0,0 +1,5 @@ +

{{$settingdescription}}

+ +{{include file="field_input.tpl" field=$nitterserver}} + +
-- 2.43.5 From c2d502d2443ae1f003a4c9aefb7e9bfaecd97f48 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 21 May 2021 14:06:47 +0200 Subject: [PATCH 04/15] some CS --- nitter/nitter.php | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/nitter/nitter.php b/nitter/nitter.php index b6630b7c..ea8e24be 100644 --- a/nitter/nitter.php +++ b/nitter/nitter.php @@ -28,16 +28,17 @@ use Friendica\Core\Addon; use Friendica\Core\Renderer; use Friendica\DI; -function nitter_install() { - Addon::registerHook ('prepare_body', 'addon/nitter/nitter.php', 'nitter_render'); +function nitter_install() +{ + Addon::registerHook ('prepare_body', 'addon/nitter/nitter.php', 'nitter_render'); } /* Handle the send data from the admin settings */ function nitter_addon_admin_post(App $a) { - $nitterserver = trim($_POST['nitterserver']); - DI::config()->set('nitter', 'server', $nitterserver); + $nitterserver = trim($_POST['nitterserver']); + DI::config()->set('nitter', 'server', $nitterserver); } /* Hook into the admin settings to let the admin choose a @@ -45,23 +46,24 @@ function nitter_addon_admin_post(App $a) */ function nitter_addon_admin(App $a, &$o) { - $nitterserver = DI::config()->get('nitter', 'server'); - $t = Renderer::getMarkupTemplate("admin.tpl", "addon/nitter/"); - $o = Renderer::replaceMacros($t, [ - '$settingdescription' => DI::l10n()->t('Which nitter server shall be used for the replacements in the post bodies? Use the URL with servername and protocol. See %s for a list of available public Nitter servers.', "https://github.com/zedeus/nitter/wiki/Instances"), - '$nitterserver' => ["nitterserver", DI::l10n()->t('Nitter server'), $nitterserver, 'http://example.com'], - '$submit' => DI::l10n()->t('Save Settings'), - ]); + $nitterserver = DI::config()->get('nitter', 'server'); + $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/nitter/'); + $o = Renderer::replaceMacros($t, [ + '$settingdescription' => DI::l10n()->t('Which nitter server shall be used for the replacements in the post bodies? Use the URL with servername and protocol. See %s for a list of available public Nitter servers.', 'https://github.com/zedeus/nitter/wiki/Instances'), + '$nitterserver' => ['nitterserver', DI::l10n()->t('Nitter server'), $nitterserver, 'http://example.com'], + '$submit' => DI::l10n()->t('Save Settings'), + ]); } /* * replace "twitter.com" with "nitter.net" */ -function nitter_render(&$a, &$o) { - // this needs to be a system setting - $nitter = DI::config()->get('nitter', 'server', 'https://nitter.net'); - if (strstr($o['html'],'https://twitter.com')) { - $o['html'] = str_replace('https://twitter.com', $nitter, $o['html']); - $o['html'] .= '

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

'; - } +function nitter_render(&$a, &$o) +{ + // this needs to be a system setting + $nitter = DI::config()->get('nitter', 'server', 'https://nitter.net'); + if (strstr($o['html'], 'https://twitter.com')) { + $o['html'] = str_replace('https://twitter.com', $nitter, $o['html']); + $o['html'] .= '

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

'; + } } -- 2.43.5 From 37e2241edb5c7b541ae8506434ad6fb1da49680f Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 21 May 2021 15:15:57 +0200 Subject: [PATCH 05/15] DE translation for the keycloakpassword addon added --- keycloakpassword/lang/de/messages.po | 60 ++++++++++++++++++++++++++++ keycloakpassword/lang/de/strings.php | 13 ++++++ 2 files changed, 73 insertions(+) create mode 100644 keycloakpassword/lang/de/messages.po create mode 100644 keycloakpassword/lang/de/strings.php diff --git a/keycloakpassword/lang/de/messages.po b/keycloakpassword/lang/de/messages.po new file mode 100644 index 00000000..a5d28060 --- /dev/null +++ b/keycloakpassword/lang/de/messages.po @@ -0,0 +1,60 @@ +# ADDON keycloakpassword +# Copyright (C) +# This file is distributed under the same license as the Friendica keycloakpassword addon package. +# +# +# Translators: +# Tobias Diekershoff , 2021 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-05-21 07:56+0200\n" +"PO-Revision-Date: 2021-05-21 12:59+0000\n" +"Last-Translator: Tobias Diekershoff , 2021\n" +"Language-Team: German (https://www.transifex.com/Friendica/teams/12172/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: keycloakpassword.php:118 +msgid "Client ID" +msgstr "ID des Clients" + +#: keycloakpassword.php:119 +msgid "" +"The name of the OpenID Connect client you created for this addon in " +"Keycloak." +msgstr "" +"Der Name des OpenID Clients den du für dieses Addon in Keycloak angelegt " +"hast." + +#: keycloakpassword.php:123 +msgid "Client secret" +msgstr "Client Geheimnis" + +#: keycloakpassword.php:124 +msgid "" +"The secret assigned to the OpenID Connect client you created for this addon " +"in Keycloak." +msgstr "Das Geheimnis, das du in Keycloak für den Client hinterlegt hast." + +#: keycloakpassword.php:128 +msgid "OpenID Connect endpoint" +msgstr "OpenID Verbindungsendpunkt" + +#: keycloakpassword.php:130 +msgid "" +"URL to the Keycloak endpoint for your client. (E.g., " +"https://example.com/auth/realms/some-realm/protocol/openid-connect)" +msgstr "" +"Die URL des Keycloak Entpunktes fpr deinen Client (z.B. " +"https://example.com/auth/realms/some-realm/protocol/openid-connect)" + +#: keycloakpassword.php:136 +msgid "Save Settings" +msgstr "Einstellungen speichern" diff --git a/keycloakpassword/lang/de/strings.php b/keycloakpassword/lang/de/strings.php new file mode 100644 index 00000000..8273a1e3 --- /dev/null +++ b/keycloakpassword/lang/de/strings.php @@ -0,0 +1,13 @@ +strings["Client ID"] = "ID des Clients"; +$a->strings["Client secret"] = "Client Geheimnis"; +$a->strings["The secret assigned to the OpenID Connect client you created for this addon in Keycloak."] = "Das Geheimnis, das du in Keycloak für den Client hinterlegt hast."; +$a->strings["OpenID Connect endpoint"] = "OpenID Verbindungsendpunkt"; +$a->strings["Save Settings"] = "Einstellungen speichern"; -- 2.43.5 From bf80f21bb94b262100eaf83e5e6ce3d09c25ec02 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 21 May 2021 22:16:36 +0200 Subject: [PATCH 06/15] Fix Drone for PR messages.po check --- .drone.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index f648ce2c..304a7453 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,21 +19,16 @@ steps: - name: clone friendica addon image: alpine/git commands: - - git clone $DRONE_REMOTE_URL addon - - git checkout $DRONE_COMMIT_REF - - name: Run default Xgettext + - git clone $DRONE_REPO_LINK addon + - cd addon/ + - git checkout $DRONE_COMMIT_BRANCH + - git fetch origin $DRONE_COMMIT_REF + - git merge $DRONE_COMMIT_SHA + - name: Run Xgettext for addons image: friendicaci/transifex commands: - - export CHANGED_FILES=($(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2)) - - export FIND_RESULT=$(printf "%s\n" "$CHANGED_FILES[@]" | sed '/^\./d' | cut -d "/" -f1 | uniq) - - for addon in $FIND_RESULT; do ./bin/run_xgettext.sh --addon $addon; done + - /xgettext-addon.sh - name: Check update necessary - image: alpine/git + image: friendicaci/transifex commands: - - cd addon/ - - if [[ $(git diff -U0 "**/messages.po" | awk '!/index|diff|\-\-\-|\+\+\+|@@|\-"POT-Creation-Date|\+"POT-Creation-Date|\+#|\-#/{print }' | wc -l) > 0 ]]; then - echo "::error file=messages.po::messages.po is out of date" - exit 1 - else - echo "Nothing to update" - fi + - /check-addons.sh -- 2.43.5 From 719dee2cffe1fcb4ac556a843e02ac2ffd5d02b1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 13:49:30 +0200 Subject: [PATCH 07/15] Add temporary missed translations --- blackout/blackout.php | 2 ++ blockbot/blockbot.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/blackout/blackout.php b/blackout/blackout.php index cfe4bbb7..3469048c 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -78,6 +78,8 @@ function blackout_redirect ($a, $b) { Logger::log('redirecting user to blackout page'); System::externalRedirect($myurl); } + + DI::l10n()->t('blub'); } function blackout_addon_admin(&$a, &$o) { diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php index b602bf63..2f2c055a 100644 --- a/blockbot/blockbot.php +++ b/blockbot/blockbot.php @@ -37,6 +37,8 @@ function blockbot_addon_admin_post(&$a) { DI::config()->set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false); DI::config()->set('blockbot', 'block_gab', $_POST['block_gab'] ?? false); DI::config()->set('blockbot', 'training', $_POST['training'] ?? false); + + DI::l10n()->t('blub'); } function blockbot_init_1(App $a) { -- 2.43.5 From 05c98064b4d624fcdf5e7481f66704056da007ea Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 13:50:42 +0200 Subject: [PATCH 08/15] Remove temporary missed translations --- blackout/blackout.php | 2 -- blockbot/blockbot.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/blackout/blackout.php b/blackout/blackout.php index 3469048c..cfe4bbb7 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -78,8 +78,6 @@ function blackout_redirect ($a, $b) { Logger::log('redirecting user to blackout page'); System::externalRedirect($myurl); } - - DI::l10n()->t('blub'); } function blackout_addon_admin(&$a, &$o) { diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php index 2f2c055a..b602bf63 100644 --- a/blockbot/blockbot.php +++ b/blockbot/blockbot.php @@ -37,8 +37,6 @@ function blockbot_addon_admin_post(&$a) { DI::config()->set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false); DI::config()->set('blockbot', 'block_gab', $_POST['block_gab'] ?? false); DI::config()->set('blockbot', 'training', $_POST['training'] ?? false); - - DI::l10n()->t('blub'); } function blockbot_init_1(App $a) { -- 2.43.5 From dbde5358c69d9204c6453e7375a1cccbb7dca86a Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 13:52:12 +0200 Subject: [PATCH 09/15] Remove github workflow --- .github/workflows/transifex.yml | 48 --------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 .github/workflows/transifex.yml diff --git a/.github/workflows/transifex.yml b/.github/workflows/transifex.yml deleted file mode 100644 index c979dd79..00000000 --- a/.github/workflows/transifex.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Transifex -on: [pull_request] - -jobs: - messages: - name: Check messages.po changes - runs-on: ubuntu-latest - steps: - - name: Install gettext - run: sudo apt-get install gettext - - - name: Checkout Friendica Base - uses: actions/checkout@v2 - with: - repository: 'friendica/friendica' - ref: ${{ github.base_ref }} - - - name: Checkout current Friendica Addons - uses: actions/checkout@v2 - with: - path: 'addon' - - - name: Get changed files - id: changes - uses: jitterbit/get-changed-files@v1 - - - name: Run Xgettext for each changed addon - run: | - addon_files=(${{ steps.changes.outputs.all }}) - find_result=$(printf "%s\n" "${addon_files[@]}" | sed '/^\./d' | cut -d "/" -f1 | uniq) - for addon in $find_result - do - ./bin/run_xgettext.sh --addon $addon - done - - - name: Check if messages.po needs an update - run: | - echo "::group::Check messages.po" - # Skip all lines of the git diff starting with "@@" or comments or starting "POT-Creation-Date" - cd addon/ - if [[ $(git diff -U0 "**/messages.po" | awk '!/index|diff|\-\-\-|\+\+\+|@@|\-"POT-Creation-Date|\+"POT-Creation-Date|\+#|\-#/{print }' | wc -l) > 0 ]]; then - echo "::error file=messages.po::messages.po is out of date" - exit 1 - else - echo "Nothing to update" - fi - echo "::endgroup::" - shell: bash -- 2.43.5 From b852a616111adea43a9b5b273c966c0f9cb2783a Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 14:12:19 +0200 Subject: [PATCH 10/15] Add PHP-CS check --- .drone.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.drone.yml b/.drone.yml index 304a7453..5b728e13 100644 --- a/.drone.yml +++ b/.drone.yml @@ -32,3 +32,40 @@ steps: image: friendicaci/transifex commands: - /check-addons.sh +--- +kind: pipeline +type: docker +name: php-cs check + +clone: + disable: true + +trigger: + event: + - pull_request + +steps: + - name: clone friendica base + image: alpine/git + commands: + - git clone https://github.com/friendica/friendica.git . + - git checkout $DRONE_COMMIT_BRANCH + - name: clone friendica addon + image: alpine/git + commands: + - git clone $DRONE_REPO_LINK addon + - cd addon/ + - git checkout $DRONE_COMMIT_BRANCH + - git fetch origin $DRONE_COMMIT_REF + - git merge $DRONE_COMMIT_SHA + - name: Install dependencies + image: composer + commands: + - ./bin/composer.phar run cs:install + - name: Run coding standards check + image: friendicaci/php-cs + commands: + - cd addon/ + - export CHANGED_FILES="$(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2 | sed -e "s/^/addon\\//")" + - cd ../ + - /check-php-cs.sh -- 2.43.5 From 622ec88fe302046de20f7eaeaa542aa1d6fbacd5 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 18:50:42 +0200 Subject: [PATCH 11/15] test-files for PHP-CS --- blockbot/test.php | 5 +++++ blockem/test.php | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 blockbot/test.php create mode 100644 blockem/test.php diff --git a/blockbot/test.php b/blockbot/test.php new file mode 100644 index 00000000..34d55a48 --- /dev/null +++ b/blockbot/test.php @@ -0,0 +1,5 @@ + Date: Sat, 22 May 2021 20:06:07 +0200 Subject: [PATCH 12/15] Remove test-files --- blockbot/test.php | 5 ----- blockem/test.php | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 blockbot/test.php delete mode 100644 blockem/test.php diff --git a/blockbot/test.php b/blockbot/test.php deleted file mode 100644 index 34d55a48..00000000 --- a/blockbot/test.php +++ /dev/null @@ -1,5 +0,0 @@ - Date: Sat, 22 May 2021 23:43:18 +0200 Subject: [PATCH 13/15] Update .drone.yml Co-authored-by: Hypolite Petovan --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5b728e13..2dfb2fda 100644 --- a/.drone.yml +++ b/.drone.yml @@ -45,7 +45,7 @@ trigger: - pull_request steps: - - name: clone friendica base + - name: Clone friendica base image: alpine/git commands: - git clone https://github.com/friendica/friendica.git . -- 2.43.5 From f4f61aa1518857247f012f27e28e45a9d0813090 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 23:43:22 +0200 Subject: [PATCH 14/15] Update .drone.yml Co-authored-by: Hypolite Petovan --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 2dfb2fda..4e3239f5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -50,7 +50,7 @@ steps: commands: - git clone https://github.com/friendica/friendica.git . - git checkout $DRONE_COMMIT_BRANCH - - name: clone friendica addon + - name: Clone friendica addon image: alpine/git commands: - git clone $DRONE_REPO_LINK addon -- 2.43.5 From d14f604049d16840d62569a212a5ac24c9981306 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 24 May 2021 06:00:23 +0000 Subject: [PATCH 15/15] Twitter: Make incoming posts unlisted --- twitter/twitter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twitter/twitter.php b/twitter/twitter.php index 41f865e8..bac4871b 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -1668,10 +1668,10 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl $postarray['app'] = strip_tags($post->source); if ($post->user->protected) { - $postarray['private'] = 1; + $postarray['private'] = Item::PRIVATE; $postarray['allow_cid'] = '<' . $self['id'] . '>'; } else { - $postarray['private'] = 0; + $postarray['private'] = Item::UNLISTED; $postarray['allow_cid'] = ''; } -- 2.43.5