From c2617bd793bedf53c7a94035a31c66e3b5b3fa62 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 7 Feb 2022 08:06:58 +0100 Subject: [PATCH 001/170] forgot to update the CHANGELOG file for the 2022.05-dev phase --- CHANGELOG | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 45131d447..96638b7e0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +Version 2022.05 (unreleased) + Friendica Core + + Friendica Addons + + Closed Issues + Version 2022.02 (2022-02-06) Friendica Core Updates to the translations AR, DE, ET, FR, GB_EN, GB_US, HU, IT, RU, SV [translation teams] From 061a6d923937f919b1d63fa7ceb0639abbeff874 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 7 Feb 2022 19:21:39 +0000 Subject: [PATCH 002/170] Use a thousands_separator to improve readability of the federation statistics --- src/Module/Admin/Federation.php | 16 ++++++++-------- view/lang/C/messages.po | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Module/Admin/Federation.php b/src/Module/Admin/Federation.php index 63564ed29..79ae08457 100644 --- a/src/Module/Admin/Federation.php +++ b/src/Module/Admin/Federation.php @@ -164,19 +164,19 @@ class Federation extends BaseAdmin } $gserver['platform'] = $systems[$platform]['name']; - $gserver['totallbl'] = DI::l10n()->t('%d total systems', $gserver['total']); - $gserver['monthlbl'] = DI::l10n()->t('%d active users last month', $gserver['month']); - $gserver['halfyearlbl'] = DI::l10n()->t('%d active users last six month', $gserver['halfyear']); - $gserver['userslbl'] = DI::l10n()->t('%d registered users', $gserver['users']); - $gserver['postslbl'] = DI::l10n()->t('%d local posts', $gserver['posts']); + $gserver['totallbl'] = DI::l10n()->t('%s total systems', number_format($gserver['total'])); + $gserver['monthlbl'] = DI::l10n()->t('%s active users last month', number_format($gserver['month'])); + $gserver['halfyearlbl'] = DI::l10n()->t('%s active users last six month', number_format($gserver['halfyear'])); + $gserver['userslbl'] = DI::l10n()->t('%s registered users', number_format($gserver['users'])); + $gserver['postslbl'] = DI::l10n()->t('%s local posts', number_format($gserver['posts'])); if (($gserver['users'] > 0) && ($gserver['posts'] > 0)) { - $gserver['postsuserlbl'] = DI::l10n()->t('%d posts per user', $gserver['posts'] / $gserver['users']); + $gserver['postsuserlbl'] = DI::l10n()->t('%s posts per user', number_format($gserver['posts'] / $gserver['users'], 1)); } else { $gserver['postsuserlbl'] = ''; } if (($gserver['users'] > 0) && ($gserver['total'] > 0)) { - $gserver['userssystemlbl'] = DI::l10n()->t('%d users per system', $gserver['users'] / $gserver['total']); + $gserver['userssystemlbl'] = DI::l10n()->t('%s users per system', number_format($gserver['users'] / $gserver['total'], 1)); } else { $gserver['userssystemlbl'] = ''; } @@ -196,7 +196,7 @@ class Federation extends BaseAdmin '$intro' => $intro, '$counts' => $counts, '$version' => FRIENDICA_VERSION, - '$legendtext' => DI::l10n()->t('Currently this node is aware of %d nodes (%d active users last month, %d active users last six month, %d registered users in total) from the following platforms:', $total, $month, $halfyear, $users), + '$legendtext' => DI::l10n()->t('Currently this node is aware of %s nodes (%s active users last month, %s active users last six month, %s registered users in total) from the following platforms:', number_format($total), number_format($month), number_format($halfyear), number_format($users)), ]); } diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 32dd77a33..210eb0454 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.05-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-07 06:23+0000\n" +"POT-Creation-Date: 2022-02-07 19:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -5119,37 +5119,37 @@ msgstr "" #: src/Module/Admin/Federation.php:167 #, php-format -msgid "%d total systems" +msgid "%s total systems" msgstr "" #: src/Module/Admin/Federation.php:168 #, php-format -msgid "%d active users last month" +msgid "%s active users last month" msgstr "" #: src/Module/Admin/Federation.php:169 #, php-format -msgid "%d active users last six month" +msgid "%s active users last six month" msgstr "" #: src/Module/Admin/Federation.php:170 #, php-format -msgid "%d registered users" +msgid "%s registered users" msgstr "" #: src/Module/Admin/Federation.php:171 #, php-format -msgid "%d local posts" +msgid "%s local posts" msgstr "" #: src/Module/Admin/Federation.php:174 #, php-format -msgid "%d posts per user" +msgid "%s posts per user" msgstr "" #: src/Module/Admin/Federation.php:179 #, php-format -msgid "%d users per system" +msgid "%s users per system" msgstr "" #: src/Module/Admin/Federation.php:189 @@ -5166,8 +5166,8 @@ msgstr "" #: src/Module/Admin/Federation.php:199 #, php-format msgid "" -"Currently this node is aware of %d nodes (%d active users last month, %d " -"active users last six month, %d registered users in total) from the " +"Currently this node is aware of %s nodes (%s active users last month, %s " +"active users last six month, %s registered users in total) from the " "following platforms:" msgstr "" From 85791348cb9c655eb6d4f7a8167dafe615dcceb4 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Tue, 8 Feb 2022 08:38:29 +0100 Subject: [PATCH 003/170] DE translation updates --- view/lang/de/messages.po | 252 +++++++++++++++++++++++---------------- view/lang/de/strings.php | 9 +- 2 files changed, 154 insertions(+), 107 deletions(-) diff --git a/view/lang/de/messages.po b/view/lang/de/messages.po index 7c17aa64d..af77795e6 100644 --- a/view/lang/de/messages.po +++ b/view/lang/de/messages.po @@ -49,8 +49,8 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-24 04:58+0000\n" -"PO-Revision-Date: 2022-01-25 08:39+0000\n" +"POT-Creation-Date: 2022-02-07 19:20+0000\n" +"PO-Revision-Date: 2022-02-08 07:00+0000\n" "Last-Translator: Tobias Diekershoff \n" "Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" "MIME-Version: 1.0\n" @@ -159,7 +159,7 @@ msgid "The feed for this item is unavailable." msgstr "Der Feed für diesen Beitrag ist nicht verfügbar." #: mod/editpost.php:38 mod/events.php:220 mod/follow.php:56 mod/follow.php:130 -#: mod/item.php:185 mod/item.php:190 mod/item.php:937 mod/message.php:69 +#: mod/item.php:185 mod/item.php:190 mod/item.php:930 mod/message.php:69 #: mod/message.php:111 mod/notes.php:44 mod/ostatus_subscribe.php:32 #: mod/photos.php:160 mod/photos.php:897 mod/repair_ostatus.php:31 #: mod/settings.php:46 mod/settings.php:56 mod/settings.php:412 @@ -505,7 +505,7 @@ msgstr "Diaspora-Unterstützung ist nicht aktiviert. Der Kontakt kann nicht zuge msgid "OStatus support is disabled. Contact can't be added." msgstr "OStatus-Unterstützung ist nicht aktiviert. Der Kontakt kann nicht zugefügt werden." -#: mod/follow.php:138 src/Content/Item.php:463 src/Content/Widget.php:76 +#: mod/follow.php:138 src/Content/Item.php:452 src/Content/Widget.php:76 #: src/Model/Contact.php:1056 src/Model/Contact.php:1068 #: view/theme/vier/theme.php:172 msgid "Connect/Follow" @@ -559,19 +559,19 @@ msgstr "Konnte den Originalbeitrag nicht finden." msgid "Empty post discarded." msgstr "Leerer Beitrag wurde verworfen." -#: mod/item.php:743 +#: mod/item.php:736 msgid "Post updated." msgstr "Beitrag aktualisiert." -#: mod/item.php:753 mod/item.php:758 +#: mod/item.php:746 mod/item.php:751 msgid "Item wasn't stored." msgstr "Eintrag wurde nicht gespeichert" -#: mod/item.php:769 +#: mod/item.php:762 msgid "Item couldn't be fetched." msgstr "Eintrag konnte nicht geholt werden." -#: mod/item.php:915 src/Module/Admin/Themes/Details.php:39 +#: mod/item.php:908 src/Module/Admin/Themes/Details.php:39 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:41 #: src/Module/Debug/ItemBody.php:56 msgid "Item not found." @@ -2006,15 +2006,15 @@ msgstr "Keine Vorschläge verfügbar. Falls der Server frisch aufgesetzt wurde, msgid "Friend Suggestions" msgstr "Kontaktvorschläge" -#: mod/tagger.php:78 src/Content/Item.php:346 src/Model/Item.php:2629 +#: mod/tagger.php:78 src/Content/Item.php:335 src/Model/Item.php:2620 msgid "photo" msgstr "Foto" -#: mod/tagger.php:78 src/Content/Item.php:341 src/Content/Item.php:350 +#: mod/tagger.php:78 src/Content/Item.php:330 src/Content/Item.php:339 msgid "status" msgstr "Status" -#: mod/tagger.php:111 src/Content/Item.php:360 +#: mod/tagger.php:111 src/Content/Item.php:349 #, php-format msgid "%1$s tagged %2$s's %3$s with %4$s" msgstr "%1$s hat %2$ss %3$s mit %4$s getaggt" @@ -2757,55 +2757,55 @@ msgstr "weniger anzeigen" msgid "show more" msgstr "mehr anzeigen" -#: src/Content/Item.php:305 +#: src/Content/Item.php:294 #, php-format msgid "%1$s poked %2$s" msgstr "%1$s stupste %2$s" -#: src/Content/Item.php:338 src/Model/Item.php:2627 +#: src/Content/Item.php:327 src/Model/Item.php:2618 msgid "event" msgstr "Veranstaltung" -#: src/Content/Item.php:442 view/theme/frio/theme.php:254 +#: src/Content/Item.php:431 view/theme/frio/theme.php:254 msgid "Follow Thread" msgstr "Folge der Unterhaltung" -#: src/Content/Item.php:443 src/Model/Contact.php:1061 +#: src/Content/Item.php:432 src/Model/Contact.php:1061 msgid "View Status" msgstr "Status anschauen" -#: src/Content/Item.php:444 src/Content/Item.php:466 src/Model/Contact.php:995 +#: src/Content/Item.php:433 src/Content/Item.php:455 src/Model/Contact.php:995 #: src/Model/Contact.php:1053 src/Model/Contact.php:1062 #: src/Module/Directory.php:157 src/Module/Settings/Profile/Index.php:225 msgid "View Profile" msgstr "Profil anschauen" -#: src/Content/Item.php:445 src/Model/Contact.php:1063 +#: src/Content/Item.php:434 src/Model/Contact.php:1063 msgid "View Photos" msgstr "Bilder anschauen" -#: src/Content/Item.php:446 src/Model/Contact.php:1054 +#: src/Content/Item.php:435 src/Model/Contact.php:1054 #: src/Model/Contact.php:1064 msgid "Network Posts" msgstr "Netzwerkbeiträge" -#: src/Content/Item.php:447 src/Model/Contact.php:1055 +#: src/Content/Item.php:436 src/Model/Contact.php:1055 #: src/Model/Contact.php:1065 msgid "View Contact" msgstr "Kontakt anzeigen" -#: src/Content/Item.php:448 src/Model/Contact.php:1066 +#: src/Content/Item.php:437 src/Model/Contact.php:1066 msgid "Send PM" msgstr "Private Nachricht senden" -#: src/Content/Item.php:449 src/Module/Admin/Blocklist/Contact.php:100 +#: src/Content/Item.php:438 src/Module/Admin/Blocklist/Contact.php:100 #: src/Module/Admin/Users/Active.php:140 src/Module/Admin/Users/Index.php:154 #: src/Module/Contact.php:398 src/Module/Contact/Profile.php:348 #: src/Module/Contact/Profile.php:449 msgid "Block" msgstr "Sperren" -#: src/Content/Item.php:450 src/Module/Contact.php:399 +#: src/Content/Item.php:439 src/Module/Contact.php:399 #: src/Module/Contact/Profile.php:349 src/Module/Contact/Profile.php:457 #: src/Module/Notifications/Introductions.php:132 #: src/Module/Notifications/Introductions.php:204 @@ -2813,11 +2813,11 @@ msgstr "Sperren" msgid "Ignore" msgstr "Ignorieren" -#: src/Content/Item.php:454 src/Object/Post.php:429 +#: src/Content/Item.php:443 src/Object/Post.php:429 msgid "Languages" msgstr "Sprachen" -#: src/Content/Item.php:458 src/Model/Contact.php:1067 +#: src/Content/Item.php:447 src/Model/Contact.php:1067 msgid "Poke" msgstr "Anstupsen" @@ -3112,8 +3112,8 @@ msgstr "Bild/Foto" msgid "%2$s %3$s" msgstr "%2$s%3$s" -#: src/Content/Text/BBCode.php:1185 src/Model/Item.php:3158 -#: src/Model/Item.php:3164 src/Model/Item.php:3165 +#: src/Content/Text/BBCode.php:1185 src/Model/Item.php:3149 +#: src/Model/Item.php:3155 src/Model/Item.php:3156 msgid "Link to source" msgstr "Link zum Originalbeitrag" @@ -3698,201 +3698,201 @@ msgstr "Die Datenbank wird bereits verwendet." msgid "Could not connect to database." msgstr "Verbindung zur Datenbank gescheitert." -#: src/Core/L10n.php:377 src/Model/Event.php:425 +#: src/Core/L10n.php:399 src/Model/Event.php:425 #: src/Module/Settings/Display.php:182 msgid "Monday" msgstr "Montag" -#: src/Core/L10n.php:377 src/Model/Event.php:426 +#: src/Core/L10n.php:399 src/Model/Event.php:426 msgid "Tuesday" msgstr "Dienstag" -#: src/Core/L10n.php:377 src/Model/Event.php:427 +#: src/Core/L10n.php:399 src/Model/Event.php:427 msgid "Wednesday" msgstr "Mittwoch" -#: src/Core/L10n.php:377 src/Model/Event.php:428 +#: src/Core/L10n.php:399 src/Model/Event.php:428 msgid "Thursday" msgstr "Donnerstag" -#: src/Core/L10n.php:377 src/Model/Event.php:429 +#: src/Core/L10n.php:399 src/Model/Event.php:429 msgid "Friday" msgstr "Freitag" -#: src/Core/L10n.php:377 src/Model/Event.php:430 +#: src/Core/L10n.php:399 src/Model/Event.php:430 msgid "Saturday" msgstr "Samstag" -#: src/Core/L10n.php:377 src/Model/Event.php:424 +#: src/Core/L10n.php:399 src/Model/Event.php:424 #: src/Module/Settings/Display.php:182 msgid "Sunday" msgstr "Sonntag" -#: src/Core/L10n.php:381 src/Model/Event.php:445 +#: src/Core/L10n.php:403 src/Model/Event.php:445 msgid "January" msgstr "Januar" -#: src/Core/L10n.php:381 src/Model/Event.php:446 +#: src/Core/L10n.php:403 src/Model/Event.php:446 msgid "February" msgstr "Februar" -#: src/Core/L10n.php:381 src/Model/Event.php:447 +#: src/Core/L10n.php:403 src/Model/Event.php:447 msgid "March" msgstr "März" -#: src/Core/L10n.php:381 src/Model/Event.php:448 +#: src/Core/L10n.php:403 src/Model/Event.php:448 msgid "April" msgstr "April" -#: src/Core/L10n.php:381 src/Core/L10n.php:401 src/Model/Event.php:436 +#: src/Core/L10n.php:403 src/Core/L10n.php:423 src/Model/Event.php:436 msgid "May" msgstr "Mai" -#: src/Core/L10n.php:381 src/Model/Event.php:449 +#: src/Core/L10n.php:403 src/Model/Event.php:449 msgid "June" msgstr "Juni" -#: src/Core/L10n.php:381 src/Model/Event.php:450 +#: src/Core/L10n.php:403 src/Model/Event.php:450 msgid "July" msgstr "Juli" -#: src/Core/L10n.php:381 src/Model/Event.php:451 +#: src/Core/L10n.php:403 src/Model/Event.php:451 msgid "August" msgstr "August" -#: src/Core/L10n.php:381 src/Model/Event.php:452 +#: src/Core/L10n.php:403 src/Model/Event.php:452 msgid "September" msgstr "September" -#: src/Core/L10n.php:381 src/Model/Event.php:453 +#: src/Core/L10n.php:403 src/Model/Event.php:453 msgid "October" msgstr "Oktober" -#: src/Core/L10n.php:381 src/Model/Event.php:454 +#: src/Core/L10n.php:403 src/Model/Event.php:454 msgid "November" msgstr "November" -#: src/Core/L10n.php:381 src/Model/Event.php:455 +#: src/Core/L10n.php:403 src/Model/Event.php:455 msgid "December" msgstr "Dezember" -#: src/Core/L10n.php:397 src/Model/Event.php:417 +#: src/Core/L10n.php:419 src/Model/Event.php:417 msgid "Mon" msgstr "Mo" -#: src/Core/L10n.php:397 src/Model/Event.php:418 +#: src/Core/L10n.php:419 src/Model/Event.php:418 msgid "Tue" msgstr "Di" -#: src/Core/L10n.php:397 src/Model/Event.php:419 +#: src/Core/L10n.php:419 src/Model/Event.php:419 msgid "Wed" msgstr "Mi" -#: src/Core/L10n.php:397 src/Model/Event.php:420 +#: src/Core/L10n.php:419 src/Model/Event.php:420 msgid "Thu" msgstr "Do" -#: src/Core/L10n.php:397 src/Model/Event.php:421 +#: src/Core/L10n.php:419 src/Model/Event.php:421 msgid "Fri" msgstr "Fr" -#: src/Core/L10n.php:397 src/Model/Event.php:422 +#: src/Core/L10n.php:419 src/Model/Event.php:422 msgid "Sat" msgstr "Sa" -#: src/Core/L10n.php:397 src/Model/Event.php:416 +#: src/Core/L10n.php:419 src/Model/Event.php:416 msgid "Sun" msgstr "So" -#: src/Core/L10n.php:401 src/Model/Event.php:432 +#: src/Core/L10n.php:423 src/Model/Event.php:432 msgid "Jan" msgstr "Jan" -#: src/Core/L10n.php:401 src/Model/Event.php:433 +#: src/Core/L10n.php:423 src/Model/Event.php:433 msgid "Feb" msgstr "Feb" -#: src/Core/L10n.php:401 src/Model/Event.php:434 +#: src/Core/L10n.php:423 src/Model/Event.php:434 msgid "Mar" msgstr "März" -#: src/Core/L10n.php:401 src/Model/Event.php:435 +#: src/Core/L10n.php:423 src/Model/Event.php:435 msgid "Apr" msgstr "Apr" -#: src/Core/L10n.php:401 src/Model/Event.php:437 +#: src/Core/L10n.php:423 src/Model/Event.php:437 msgid "Jun" msgstr "Jun" -#: src/Core/L10n.php:401 src/Model/Event.php:438 +#: src/Core/L10n.php:423 src/Model/Event.php:438 msgid "Jul" msgstr "Juli" -#: src/Core/L10n.php:401 src/Model/Event.php:439 +#: src/Core/L10n.php:423 src/Model/Event.php:439 msgid "Aug" msgstr "Aug" -#: src/Core/L10n.php:401 +#: src/Core/L10n.php:423 msgid "Sep" msgstr "Sep" -#: src/Core/L10n.php:401 src/Model/Event.php:441 +#: src/Core/L10n.php:423 src/Model/Event.php:441 msgid "Oct" msgstr "Okt" -#: src/Core/L10n.php:401 src/Model/Event.php:442 +#: src/Core/L10n.php:423 src/Model/Event.php:442 msgid "Nov" msgstr "Nov" -#: src/Core/L10n.php:401 src/Model/Event.php:443 +#: src/Core/L10n.php:423 src/Model/Event.php:443 msgid "Dec" msgstr "Dez" -#: src/Core/L10n.php:420 +#: src/Core/L10n.php:442 msgid "poke" msgstr "anstupsen" -#: src/Core/L10n.php:420 +#: src/Core/L10n.php:442 msgid "poked" msgstr "stupste" -#: src/Core/L10n.php:421 +#: src/Core/L10n.php:443 msgid "ping" msgstr "anpingen" -#: src/Core/L10n.php:421 +#: src/Core/L10n.php:443 msgid "pinged" msgstr "pingte" -#: src/Core/L10n.php:422 +#: src/Core/L10n.php:444 msgid "prod" msgstr "knuffen" -#: src/Core/L10n.php:422 +#: src/Core/L10n.php:444 msgid "prodded" msgstr "knuffte" -#: src/Core/L10n.php:423 +#: src/Core/L10n.php:445 msgid "slap" msgstr "ohrfeigen" -#: src/Core/L10n.php:423 +#: src/Core/L10n.php:445 msgid "slapped" msgstr "ohrfeigte" -#: src/Core/L10n.php:424 +#: src/Core/L10n.php:446 msgid "finger" msgstr "befummeln" -#: src/Core/L10n.php:424 +#: src/Core/L10n.php:446 msgid "fingered" msgstr "befummelte" -#: src/Core/L10n.php:425 +#: src/Core/L10n.php:447 msgid "rebuff" msgstr "eine Abfuhr erteilen" -#: src/Core/L10n.php:425 +#: src/Core/L10n.php:447 msgid "rebuffed" msgstr "abfuhrerteilte" @@ -4109,63 +4109,63 @@ msgstr "Organisation" msgid "Forum" msgstr "Forum" -#: src/Model/Contact.php:2426 +#: src/Model/Contact.php:2433 msgid "Disallowed profile URL." msgstr "Nicht erlaubte Profil-URL." -#: src/Model/Contact.php:2431 src/Module/Friendica.php:81 +#: src/Model/Contact.php:2438 src/Module/Friendica.php:81 msgid "Blocked domain" msgstr "Blockierte Domain" -#: src/Model/Contact.php:2436 +#: src/Model/Contact.php:2443 msgid "Connect URL missing." msgstr "Connect-URL fehlt" -#: src/Model/Contact.php:2445 +#: src/Model/Contact.php:2452 msgid "" "The contact could not be added. Please check the relevant network " "credentials in your Settings -> Social Networks page." msgstr "Der Kontakt konnte nicht hinzugefügt werden. Bitte überprüfe die Einstellungen unter Einstellungen -> Soziale Netzwerke" -#: src/Model/Contact.php:2482 +#: src/Model/Contact.php:2489 msgid "The profile address specified does not provide adequate information." msgstr "Die angegebene Profiladresse liefert unzureichende Informationen." -#: src/Model/Contact.php:2484 +#: src/Model/Contact.php:2491 msgid "No compatible communication protocols or feeds were discovered." msgstr "Es wurden keine kompatiblen Kommunikationsprotokolle oder Feeds gefunden." -#: src/Model/Contact.php:2487 +#: src/Model/Contact.php:2494 msgid "An author or name was not found." msgstr "Es wurde kein Autor oder Name gefunden." -#: src/Model/Contact.php:2490 +#: src/Model/Contact.php:2497 msgid "No browser URL could be matched to this address." msgstr "Zu dieser Adresse konnte keine passende Browser-URL gefunden werden." -#: src/Model/Contact.php:2493 +#: src/Model/Contact.php:2500 msgid "" "Unable to match @-style Identity Address with a known protocol or email " "contact." msgstr "Konnte die @-Adresse mit keinem der bekannten Protokolle oder Email-Kontakte abgleichen." -#: src/Model/Contact.php:2494 +#: src/Model/Contact.php:2501 msgid "Use mailto: in front of address to force email check." msgstr "Verwende mailto: vor der E-Mail-Adresse, um eine Überprüfung der E-Mail-Adresse zu erzwingen." -#: src/Model/Contact.php:2500 +#: src/Model/Contact.php:2507 msgid "" "The profile address specified belongs to a network which has been disabled " "on this site." msgstr "Die Adresse dieses Profils gehört zu einem Netzwerk, mit dem die Kommunikation auf dieser Seite ausgeschaltet wurde." -#: src/Model/Contact.php:2505 +#: src/Model/Contact.php:2512 msgid "" "Limited profile. This person will be unable to receive direct/personal " "notifications from you." msgstr "Eingeschränktes Profil. Diese Person wird keine direkten/privaten Nachrichten von dir erhalten können." -#: src/Model/Contact.php:2564 +#: src/Model/Contact.php:2571 msgid "Unable to retrieve contact information." msgstr "Konnte die Kontaktinformationen nicht empfangen." @@ -4285,33 +4285,33 @@ msgstr "Gruppenname:" msgid "Edit groups" msgstr "Gruppen bearbeiten" -#: src/Model/Item.php:1680 +#: src/Model/Item.php:1691 #, php-format msgid "Detected languages in this post:\\n%s" msgstr "Erkannte Sprachen in diesem Beitrag:\\n%s" -#: src/Model/Item.php:2631 +#: src/Model/Item.php:2622 msgid "activity" msgstr "Aktivität" -#: src/Model/Item.php:2633 +#: src/Model/Item.php:2624 msgid "comment" msgstr "Kommentar" -#: src/Model/Item.php:2636 +#: src/Model/Item.php:2627 msgid "post" msgstr "Beitrag" -#: src/Model/Item.php:2773 +#: src/Model/Item.php:2764 #, php-format msgid "Content warning: %s" msgstr "Inhaltswarnung: %s" -#: src/Model/Item.php:3123 +#: src/Model/Item.php:3114 msgid "bytes" msgstr "Byte" -#: src/Model/Item.php:3152 src/Model/Item.php:3153 +#: src/Model/Item.php:3143 src/Model/Item.php:3144 msgid "View on separate page" msgstr "Auf separater Seite ansehen" @@ -4729,7 +4729,7 @@ msgstr "Einschalten" #: src/Module/Admin/Blocklist/Contact.php:94 #: src/Module/Admin/Blocklist/Server/Add.php:89 #: src/Module/Admin/Blocklist/Server/Index.php:78 -#: src/Module/Admin/Federation.php:159 src/Module/Admin/Item/Delete.php:64 +#: src/Module/Admin/Federation.php:194 src/Module/Admin/Item/Delete.php:64 #: src/Module/Admin/Logs/Settings.php:79 src/Module/Admin/Logs/View.php:83 #: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:498 #: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:232 @@ -5141,31 +5141,67 @@ msgstr "Feature festlegen: %s" msgid "Manage Additional Features" msgstr "Zusätzliche Features Verwalten" -#: src/Module/Admin/Federation.php:56 +#: src/Module/Admin/Federation.php:63 msgid "Other" msgstr "Andere" -#: src/Module/Admin/Federation.php:118 src/Module/Admin/Federation.php:348 +#: src/Module/Admin/Federation.php:134 src/Module/Admin/Federation.php:383 msgid "unknown" msgstr "Unbekannt" -#: src/Module/Admin/Federation.php:154 +#: src/Module/Admin/Federation.php:167 +#, php-format +msgid "%s total systems" +msgstr "%s Server gesamt" + +#: src/Module/Admin/Federation.php:168 +#, php-format +msgid "%s active users last month" +msgstr "%s aktive Accounts im letzten Monat" + +#: src/Module/Admin/Federation.php:169 +#, php-format +msgid "%s active users last six month" +msgstr "%s aktive Accounts im letzten halben Jahr" + +#: src/Module/Admin/Federation.php:170 +#, php-format +msgid "%s registered users" +msgstr "%s registrierte Accounts" + +#: src/Module/Admin/Federation.php:171 +#, php-format +msgid "%s local posts" +msgstr "%s lokale Beiträge" + +#: src/Module/Admin/Federation.php:174 +#, php-format +msgid "%s posts per user" +msgstr "%s Beiträge pro Account" + +#: src/Module/Admin/Federation.php:179 +#, php-format +msgid "%s users per system" +msgstr "%s Accounts pro Server" + +#: src/Module/Admin/Federation.php:189 msgid "" "This page offers you some numbers to the known part of the federated social " "network your Friendica node is part of. These numbers are not complete but " "only reflect the part of the network your node is aware of." msgstr "Diese Seite präsentiert einige Zahlen zu dem bekannten Teil des föderalen sozialen Netzwerks, von dem deine Friendica Installation ein Teil ist. Diese Zahlen sind nicht absolut und reflektieren nur den Teil des Netzwerks, den dein Knoten kennt." -#: src/Module/Admin/Federation.php:160 src/Module/BaseAdmin.php:87 +#: src/Module/Admin/Federation.php:195 src/Module/BaseAdmin.php:87 msgid "Federation Statistics" msgstr "Föderation Statistik" -#: src/Module/Admin/Federation.php:164 +#: src/Module/Admin/Federation.php:199 #, php-format msgid "" -"Currently this node is aware of %d nodes with %d registered users from the " +"Currently this node is aware of %s nodes (%s active users last month, %s " +"active users last six month, %s registered users in total) from the " "following platforms:" -msgstr "Momentan kennt dieser Knoten %d Knoten mit insgesamt %d registrierten Nutzern, die die folgenden Plattformen verwenden:" +msgstr "Derzeit kennt dieser Knoten %s andere Knoten (mit %s aktiven Accounts im letzten Monat, %s aktiven Accounts im letzten halben Jahrm %s registrierten Accounts insgesamt) von den folgenden Plattforment:" #: src/Module/Admin/Item/Delete.php:53 msgid "Item marked for deletion." @@ -8644,19 +8680,19 @@ msgstr "Betrachten als" #: src/Module/Profile/Profile.php:326 src/Module/Profile/Profile.php:329 #: src/Module/Profile/Status.php:65 src/Module/Profile/Status.php:68 -#: src/Protocol/Feed.php:985 src/Protocol/OStatus.php:1242 +#: src/Protocol/Feed.php:990 src/Protocol/OStatus.php:1242 #, php-format msgid "%s's timeline" msgstr "Timeline von %s" #: src/Module/Profile/Profile.php:327 src/Module/Profile/Status.php:66 -#: src/Protocol/Feed.php:989 src/Protocol/OStatus.php:1246 +#: src/Protocol/Feed.php:994 src/Protocol/OStatus.php:1246 #, php-format msgid "%s's posts" msgstr "Beiträge von %s" #: src/Module/Profile/Profile.php:328 src/Module/Profile/Status.php:67 -#: src/Protocol/Feed.php:992 src/Protocol/OStatus.php:1249 +#: src/Protocol/Feed.php:997 src/Protocol/OStatus.php:1249 #, php-format msgid "%s's comments" msgstr "Kommentare von %s" @@ -10030,21 +10066,25 @@ msgid "%1$s shared your post %2$s" msgstr "%1$s hat deinen Beitrag %2$s geteilt" #: src/Navigation/Notifications/Factory/Notification.php:176 +#: src/Navigation/Notifications/Factory/Notification.php:245 #, php-format msgid "%1$s shared the post %2$s from %3$s" msgstr "%1$s hat den Beitrag %2$s von %3$s geteilt" #: src/Navigation/Notifications/Factory/Notification.php:178 +#: src/Navigation/Notifications/Factory/Notification.php:247 #, php-format msgid "%1$s shared a post from %3$s" msgstr "%1$s hat einen Beitrag von %3$s geteilt" #: src/Navigation/Notifications/Factory/Notification.php:180 +#: src/Navigation/Notifications/Factory/Notification.php:249 #, php-format msgid "%1$s shared the post %2$s" msgstr "%1$s hat den Beitrag %2$s geteilt" #: src/Navigation/Notifications/Factory/Notification.php:182 +#: src/Navigation/Notifications/Factory/Notification.php:251 #, php-format msgid "%1$s shared a post" msgstr "%1$s hat einen Beitrag geteilt" diff --git a/view/lang/de/strings.php b/view/lang/de/strings.php index b99423bc5..914bb3c14 100644 --- a/view/lang/de/strings.php +++ b/view/lang/de/strings.php @@ -1338,9 +1338,16 @@ $a->strings['Lock feature %s'] = 'Feature festlegen: %s'; $a->strings['Manage Additional Features'] = 'Zusätzliche Features Verwalten'; $a->strings['Other'] = 'Andere'; $a->strings['unknown'] = 'Unbekannt'; +$a->strings['%s total systems'] = '%s Server gesamt'; +$a->strings['%s active users last month'] = '%s aktive Accounts im letzten Monat'; +$a->strings['%s active users last six month'] = '%s aktive Accounts im letzten halben Jahr'; +$a->strings['%s registered users'] = '%s registrierte Accounts'; +$a->strings['%s local posts'] = '%s lokale Beiträge'; +$a->strings['%s posts per user'] = '%s Beiträge pro Account'; +$a->strings['%s users per system'] = '%s Accounts pro Server'; $a->strings['This page offers you some numbers to the known part of the federated social network your Friendica node is part of. These numbers are not complete but only reflect the part of the network your node is aware of.'] = 'Diese Seite präsentiert einige Zahlen zu dem bekannten Teil des föderalen sozialen Netzwerks, von dem deine Friendica Installation ein Teil ist. Diese Zahlen sind nicht absolut und reflektieren nur den Teil des Netzwerks, den dein Knoten kennt.'; $a->strings['Federation Statistics'] = 'Föderation Statistik'; -$a->strings['Currently this node is aware of %d nodes with %d registered users from the following platforms:'] = 'Momentan kennt dieser Knoten %d Knoten mit insgesamt %d registrierten Nutzern, die die folgenden Plattformen verwenden:'; +$a->strings['Currently this node is aware of %s nodes (%s active users last month, %s active users last six month, %s registered users in total) from the following platforms:'] = 'Derzeit kennt dieser Knoten %s andere Knoten (mit %s aktiven Accounts im letzten Monat, %s aktiven Accounts im letzten halben Jahrm %s registrierten Accounts insgesamt) von den folgenden Plattforment:'; $a->strings['Item marked for deletion.'] = 'Eintrag wurden zur Löschung markiert'; $a->strings['Delete Item'] = 'Eintrag löschen'; $a->strings['Delete this Item'] = 'Diesen Eintrag löschen'; From f87b80266cb83fc6ca01391958cafd4aaa26fa3c Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 8 Feb 2022 21:05:15 +0000 Subject: [PATCH 004/170] Display followers for followers of private forums --- src/Module/ActivityPub/Followers.php | 3 ++- src/Protocol/ActivityPub/Transmitter.php | 23 +++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/Module/ActivityPub/Followers.php b/src/Module/ActivityPub/Followers.php index fbf5bf282..54584de18 100644 --- a/src/Module/ActivityPub/Followers.php +++ b/src/Module/ActivityPub/Followers.php @@ -25,6 +25,7 @@ use Friendica\BaseModule; use Friendica\Model\Contact; use Friendica\Model\User; use Friendica\Protocol\ActivityPub; +use Friendica\Util\HTTPSignature; /** * ActivityPub Followers @@ -45,7 +46,7 @@ class Followers extends BaseModule $page = $_REQUEST['page'] ?? null; - $followers = ActivityPub\Transmitter::getContacts($owner, [Contact::FOLLOWER, Contact::FRIEND], 'followers', $page); + $followers = ActivityPub\Transmitter::getContacts($owner, [Contact::FOLLOWER, Contact::FRIEND], 'followers', $page, (string)HTTPSignature::getSigner('', $_SERVER)); header('Content-Type: application/activity+json'); echo json_encode($followers); diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 0b7159ec9..6a1dacf0a 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -36,7 +36,6 @@ use Friendica\Model\GServer; use Friendica\Model\Item; use Friendica\Model\Photo; use Friendica\Model\Post; -use Friendica\Model\Profile; use Friendica\Model\Tag; use Friendica\Model\User; use Friendica\Network\HTTPException; @@ -49,6 +48,7 @@ use Friendica\Util\JsonLD; use Friendica\Util\LDSignature; use Friendica\Util\Map; use Friendica\Util\Network; +use Friendica\Util\Strings; use Friendica\Util\XML; /** @@ -146,15 +146,16 @@ class Transmitter /** * Collects a list of contacts of the given owner * - * @param array $owner Owner array - * @param int|array $rel The relevant value(s) contact.rel should match - * @param string $module The name of the relevant AP endpoint module (followers|following) - * @param integer $page Page number + * @param array $owner Owner array + * @param int|array $rel The relevant value(s) contact.rel should match + * @param string $module The name of the relevant AP endpoint module (followers|following) + * @param integer $page Page number + * @param string $requester URL of the requester * * @return array of owners * @throws \Exception */ - public static function getContacts($owner, $rel, $module, $page = null) + public static function getContacts($owner, $rel, $module, $page = null, string $requester = null) { $parameters = [ 'rel' => $rel, @@ -179,8 +180,14 @@ class Transmitter $data['totalItems'] = $total; // When we hide our friends we will only show the pure number but don't allow more. - $profile = Profile::getByUID($owner['uid']); - if (!empty($profile['hide-friends'])) { + $show_contacts = empty($owner['hide-friends']); + + // Allow fetching the contact list when the requester is part of the list. + if (($owner['page-flags'] == User::PAGE_FLAGS_PRVGROUP) && !empty($requester)) { + $show_contacts = DBA::exists('contact', ['nurl' => Strings::normaliseLink($requester), 'rel' => $rel]); + } + + if (!$show_contacts) { return $data; } From 14f0a1a1ed229ae8b5e779fb103204ff0c536a8b Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 8 Feb 2022 21:28:42 +0000 Subject: [PATCH 005/170] Don't throw an exception when the database query fails --- src/Database/Database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Database/Database.php b/src/Database/Database.php index cc7f754ee..f478d7993 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -138,6 +138,7 @@ class Database try { $this->connection = @new PDO($connect, $user, $pass, [PDO::ATTR_PERSISTENT => $persistent]); $this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, $this->pdo_emulate_prepares); + $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); $this->connected = true; } catch (PDOException $e) { $this->connected = false; From b857c26999975fc86a8fb1db8a31b4e2a33a0446 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 9 Feb 2022 05:56:12 +0000 Subject: [PATCH 006/170] Use "account-type" instead of "page-flags" --- src/Module/Profile/Status.php | 2 +- src/Module/Settings/Profile/Index.php | 2 +- src/Navigation/Notifications/Repository/Notify.php | 4 ++-- src/Protocol/ActivityPub/Transmitter.php | 12 ++++++------ src/Protocol/DFRN.php | 9 +++------ src/Protocol/Diaspora.php | 2 +- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 2bb7b6eaa..1c07281b2 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -159,7 +159,7 @@ class Status extends BaseProfile // Does the profile page belong to a forum? // If not then we can improve the performance with an additional condition - $condition2 = ['uid' => $profile['uid'], 'page-flags' => [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]]; + $condition2 = ['uid' => $profile['uid'], 'account-type' => User::ACCOUNT_TYPE_COMMUNITY]; if (!DBA::exists('user', $condition2)) { $condition = DBA::mergeConditions($condition, ['contact-id' => $profile['id']]); } diff --git a/src/Module/Settings/Profile/Index.php b/src/Module/Settings/Profile/Index.php index adc4fa68d..49130e8c5 100644 --- a/src/Module/Settings/Profile/Index.php +++ b/src/Module/Settings/Profile/Index.php @@ -208,7 +208,7 @@ class Index extends BaseSettings '$baseurl' => DI::baseUrl()->get(true), ]); - $personal_account = !in_array($profile['page-flags'], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]); + $personal_account = ($profile['account-type'] != User::ACCOUNT_TYPE_COMMUNITY); $tpl = Renderer::getMarkupTemplate('settings/profile/index.tpl'); $o .= Renderer::replaceMacros($tpl, [ diff --git a/src/Navigation/Notifications/Repository/Notify.php b/src/Navigation/Notifications/Repository/Notify.php index 9b195a753..6d56258b3 100644 --- a/src/Navigation/Notifications/Repository/Notify.php +++ b/src/Navigation/Notifications/Repository/Notify.php @@ -216,7 +216,7 @@ class Notify extends BaseRepository } // Ensure that the important fields are set at any time - $fields = ['nickname', 'page-flags', 'notify-flags', 'language', 'username', 'email']; + $fields = ['nickname', 'account-type', 'notify-flags', 'language', 'username', 'email']; $user = DBA::selectFirst('user', $fields, ['uid' => $params['uid']]); if (!DBA::isResult($user)) { @@ -225,7 +225,7 @@ class Notify extends BaseRepository } // There is no need to create notifications for forum accounts - if (in_array($user['page-flags'], [Model\User::PAGE_FLAGS_COMMUNITY, Model\User::PAGE_FLAGS_PRVGROUP])) { + if ($user['account-type'] == Model\User::ACCOUNT_TYPE_COMMUNITY) { return false; } diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 0b7159ec9..31c6d2295 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -505,13 +505,13 @@ class Transmitter * @param array $item Item array * @param boolean $blindcopy addressing via "bcc" or "cc"? * @param integer $last_id Last item id for adding receivers - * @param boolean $forum_mode "true" means that we are sending content to a forum + * @param boolean $forum_post "true" means that we are sending content to a forum * * @return array with permission data * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ - private static function createPermissionBlockForItem($item, $blindcopy, $last_id = 0, $forum_mode = false) + private static function createPermissionBlockForItem($item, $blindcopy, $last_id = 0, $forum_post = false) { if ($last_id == 0) { $last_id = $item['id']; @@ -638,7 +638,7 @@ class Transmitter // Public thread parent post always are directed to the followers. // This mustn't be done by posts that are directed to forum servers via the exclusive mention. // But possibly in that case we could add the "followers" collection of the forum to the message. - if (($item['private'] != Item::PRIVATE) && !$forum_mode) { + if (($item['private'] != Item::PRIVATE) && !$forum_post) { $data['cc'][] = $actor_profile['followers']; } } @@ -808,14 +808,14 @@ class Transmitter * @param integer $uid User ID * @param boolean $personal fetch personal inboxes * @param integer $last_id Last item id for adding receivers - * @param boolean $forum_mode "true" means that we are sending content to a forum + * @param boolean $forum_post "true" means that we are sending content to a forum * @return array with inboxes * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ - public static function fetchTargetInboxes($item, $uid, $personal = false, $last_id = 0, $forum_mode = false) + public static function fetchTargetInboxes($item, $uid, $personal = false, $last_id = 0, $forum_post = false) { - $permissions = self::createPermissionBlockForItem($item, true, $last_id, $forum_mode); + $permissions = self::createPermissionBlockForItem($item, true, $last_id, $forum_post); if (empty($permissions)) { return []; } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 3a14a0db9..833c616ab 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1547,7 +1547,7 @@ class DFRN if ($item["thr-parent"] != $item["uri"]) { $community = false; - if ($importer["page-flags"] == User::PAGE_FLAGS_COMMUNITY || $importer["page-flags"] == User::PAGE_FLAGS_PRVGROUP) { + if ($importer['account-type'] == User::ACCOUNT_TYPE_COMMUNITY) { $sql_extra = ""; $community = true; Logger::notice("possible community action"); @@ -2381,14 +2381,11 @@ class DFRN return false; } - $user = DBA::selectFirst('user', ['page-flags', 'nickname'], ['uid' => $uid]); + $user = DBA::selectFirst('user', ['account-type', 'nickname'], ['uid' => $uid]); if (!DBA::isResult($user)) { return false; } - $community_page = ($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY); - $prvgroup = ($user['page-flags'] == User::PAGE_FLAGS_PRVGROUP); - $link = Strings::normaliseLink(DI::baseUrl() . '/profile/' . $user['nickname']); /* @@ -2411,7 +2408,7 @@ class DFRN return false; } - return $community_page || $prvgroup; + return ($user['account-type'] == User::ACCOUNT_TYPE_COMMUNITY); } /** diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 45879df2a..aba79364f 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -859,7 +859,7 @@ class Diaspora // Yes, then it is fine. return true; // Is it a post to a community? - } elseif (($contact["rel"] == Contact::FOLLOWER) && in_array($importer["page-flags"], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) { + } elseif (($contact["rel"] == Contact::FOLLOWER) && ($importer['account-type'] == User::ACCOUNT_TYPE_COMMUNITY)) { // That's good return true; // Is the message a global user or a comment? From 5a334deeaf7a32510bc3a9e5d2617534461a5832 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 9 Feb 2022 07:35:02 +0100 Subject: [PATCH 007/170] DE translation updats --- view/lang/de/messages.po | 4 ++-- view/lang/de/strings.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/view/lang/de/messages.po b/view/lang/de/messages.po index af77795e6..d1421e82b 100644 --- a/view/lang/de/messages.po +++ b/view/lang/de/messages.po @@ -50,7 +50,7 @@ msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-02-07 19:20+0000\n" -"PO-Revision-Date: 2022-02-08 07:00+0000\n" +"PO-Revision-Date: 2022-02-09 06:14+0000\n" "Last-Translator: Tobias Diekershoff \n" "Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" "MIME-Version: 1.0\n" @@ -5201,7 +5201,7 @@ msgid "" "Currently this node is aware of %s nodes (%s active users last month, %s " "active users last six month, %s registered users in total) from the " "following platforms:" -msgstr "Derzeit kennt dieser Knoten %s andere Knoten (mit %s aktiven Accounts im letzten Monat, %s aktiven Accounts im letzten halben Jahrm %s registrierten Accounts insgesamt) von den folgenden Plattforment:" +msgstr "Derzeit kennt dieser Knoten %s andere Knoten (mit %s aktiven Accounts im letzten Monat, %s aktiven Accounts im letzten halben Jahr, %s registrierten Accounts insgesamt) von den folgenden Plattforment:" #: src/Module/Admin/Item/Delete.php:53 msgid "Item marked for deletion." diff --git a/view/lang/de/strings.php b/view/lang/de/strings.php index 914bb3c14..603ee81dc 100644 --- a/view/lang/de/strings.php +++ b/view/lang/de/strings.php @@ -1347,7 +1347,7 @@ $a->strings['%s posts per user'] = '%s Beiträge pro Account'; $a->strings['%s users per system'] = '%s Accounts pro Server'; $a->strings['This page offers you some numbers to the known part of the federated social network your Friendica node is part of. These numbers are not complete but only reflect the part of the network your node is aware of.'] = 'Diese Seite präsentiert einige Zahlen zu dem bekannten Teil des föderalen sozialen Netzwerks, von dem deine Friendica Installation ein Teil ist. Diese Zahlen sind nicht absolut und reflektieren nur den Teil des Netzwerks, den dein Knoten kennt.'; $a->strings['Federation Statistics'] = 'Föderation Statistik'; -$a->strings['Currently this node is aware of %s nodes (%s active users last month, %s active users last six month, %s registered users in total) from the following platforms:'] = 'Derzeit kennt dieser Knoten %s andere Knoten (mit %s aktiven Accounts im letzten Monat, %s aktiven Accounts im letzten halben Jahrm %s registrierten Accounts insgesamt) von den folgenden Plattforment:'; +$a->strings['Currently this node is aware of %s nodes (%s active users last month, %s active users last six month, %s registered users in total) from the following platforms:'] = 'Derzeit kennt dieser Knoten %s andere Knoten (mit %s aktiven Accounts im letzten Monat, %s aktiven Accounts im letzten halben Jahr, %s registrierten Accounts insgesamt) von den folgenden Plattforment:'; $a->strings['Item marked for deletion.'] = 'Eintrag wurden zur Löschung markiert'; $a->strings['Delete Item'] = 'Eintrag löschen'; $a->strings['Delete this Item'] = 'Diesen Eintrag löschen'; From 9a764516d0c9da99a7dd4fcde252c685b9de0a99 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 9 Feb 2022 06:52:16 +0000 Subject: [PATCH 008/170] Use the "contact-type" instead of "forum" or "prv" --- database.sql | 2 +- src/Content/Widget/VCard.php | 2 +- src/Model/Contact.php | 31 ++++------------------------- src/Model/Profile.php | 2 +- src/Module/Contact.php | 2 +- src/Module/Contact/Hovercard.php | 2 +- src/Module/Contact/Profile.php | 2 +- src/Module/Conversation/Network.php | 2 +- src/Module/Directory.php | 2 +- src/Protocol/DFRN.php | 4 ++-- static/dbstructure.config.php | 2 +- update.php | 9 +++++++++ 12 files changed, 24 insertions(+), 38 deletions(-) diff --git a/database.sql b/database.sql index b7a923618..4237bcce3 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2022.05-dev (Siberian Iris) --- DB_UPDATE_VERSION 1450 +-- DB_UPDATE_VERSION 1451 -- ------------------------------------------ diff --git a/src/Content/Widget/VCard.php b/src/Content/Widget/VCard.php index d230afd30..7f75c6c9c 100644 --- a/src/Content/Widget/VCard.php +++ b/src/Content/Widget/VCard.php @@ -99,7 +99,7 @@ class VCard '$network_link' => $network_link, '$network_avatar' => $network_avatar, '$network' => DI::l10n()->t('Network:'), - '$account_type' => Contact::getAccountType($contact), + '$account_type' => Contact::getAccountType($contact['contact-type']), '$follow' => DI::l10n()->t('Follow'), '$follow_link' => $follow_link, '$unfollow' => DI::l10n()->t('Unfollow'), diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 0af28a740..1b39247f4 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1457,34 +1457,11 @@ class Contact * * The function can be called with either the user or the contact array * - * @param array $contact contact or user array + * @param int $type type of contact or account * @return string */ - public static function getAccountType(array $contact) + public static function getAccountType(int $type) { - // There are several fields that indicate that the contact or user is a forum - // "page-flags" is a field in the user table, - // "forum" and "prv" are used in the contact table. They stand for User::PAGE_FLAGS_COMMUNITY and User::PAGE_FLAGS_PRVGROUP. - if ((isset($contact['page-flags']) && (intval($contact['page-flags']) == User::PAGE_FLAGS_COMMUNITY)) - || (isset($contact['page-flags']) && (intval($contact['page-flags']) == User::PAGE_FLAGS_PRVGROUP)) - || (isset($contact['forum']) && intval($contact['forum'])) - || (isset($contact['prv']) && intval($contact['prv'])) - || (isset($contact['community']) && intval($contact['community'])) - ) { - $type = self::TYPE_COMMUNITY; - } else { - $type = self::TYPE_PERSON; - } - - // The "contact-type" (contact table) and "account-type" (user table) are more general then the chaos from above. - if (isset($contact["contact-type"])) { - $type = $contact["contact-type"]; - } - - if (isset($contact["account-type"])) { - $type = $contact["account-type"]; - } - switch ($type) { case self::TYPE_ORGANISATION: $account_type = DI::l10n()->t("Organisation"); @@ -2947,7 +2924,7 @@ class Contact */ public static function isForum($contactid) { - $fields = ['contact-type', 'forum', 'prv']; + $fields = ['contact-type']; $condition = ['id' => $contactid]; $contact = DBA::selectFirst('contact', $fields, $condition); if (!DBA::isResult($contact)) { @@ -2955,7 +2932,7 @@ class Contact } // Is it a forum? - return (($contact['contact-type'] == self::TYPE_COMMUNITY) || $contact['forum'] || $contact['prv']); + return ($contact['contact-type'] == self::TYPE_COMMUNITY); } /** diff --git a/src/Model/Profile.php b/src/Model/Profile.php index cb7fa6547..d77935520 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -362,7 +362,7 @@ class Profile } // Fetch the account type - $account_type = Contact::getAccountType($profile); + $account_type = Contact::getAccountType($profile['account-type']); if (!empty($profile['address']) || !empty($profile['location'])) { $location = DI::l10n()->t('Location:'); diff --git a/src/Module/Contact.php b/src/Module/Contact.php index d571016f1..c7b2870ec 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -558,7 +558,7 @@ class Contact extends BaseModule 'details' => $contact['location'], 'tags' => $contact['keywords'], 'about' => $contact['about'], - 'account_type' => Model\Contact::getAccountType($contact), + 'account_type' => Model\Contact::getAccountType($contact['contact-type']), 'sparkle' => $sparkle, 'itemurl' => ($contact['addr'] ?? '') ?: $contact['url'], 'network' => ContactSelector::networkToName($contact['network'], $contact['url'], $contact['protocol'], $contact['gsid']), diff --git a/src/Module/Contact/Hovercard.php b/src/Module/Contact/Hovercard.php index ec77a19cb..cd03e2533 100644 --- a/src/Module/Contact/Hovercard.php +++ b/src/Module/Contact/Hovercard.php @@ -101,7 +101,7 @@ class Hovercard extends BaseModule 'network_link' => Strings::formatNetworkName($contact['network'], $contact['url']), 'tags' => $contact['keywords'], 'bd' => $contact['bd'] <= DBA::NULL_DATE ? '' : $contact['bd'], - 'account_type' => Contact::getAccountType($contact), + 'account_type' => Contact::getAccountType($contact['contact-type']), 'actions' => $actions, ], ]); diff --git a/src/Module/Contact/Profile.php b/src/Module/Contact/Profile.php index e02a6a3dc..8ab8dae60 100644 --- a/src/Module/Contact/Profile.php +++ b/src/Module/Contact/Profile.php @@ -364,7 +364,7 @@ class Profile extends BaseModule '$url' => $url, '$profileurllabel' => $this->t('Profile URL'), '$profileurl' => $contact['url'], - '$account_type' => Contact::getAccountType($contact), + '$account_type' => Contact::getAccountType($contact['contact-type']), '$location' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['location']), '$location_label' => $this->t('Location:'), '$xmpp' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['xmpp']), diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index 908d0a63b..2978ecbb9 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -119,7 +119,7 @@ class Network extends BaseModule if (self::$forumContactId) { // If self::$forumContactId belongs to a communitity forum or a privat goup,.add a mention to the status editor - $condition = ["`id` = ? AND (`forum` OR `prv`)", self::$forumContactId]; + $condition = ["`id` = ? AND `contact-type` = ?", self::$forumContactId, Contact::TYPE_COMMUNITY]; $contact = DBA::selectFirst('contact', ['addr'], $condition); if (!empty($contact['addr'])) { $content = '!' . $contact['addr']; diff --git a/src/Module/Directory.php b/src/Module/Directory.php index 3a0a9fa34..8d7b8611b 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -165,7 +165,7 @@ class Directory extends BaseModule 'img_hover' => $contact['name'], 'name' => $contact['name'], 'details' => $details, - 'account_type' => Model\Contact::getAccountType($contact), + 'account_type' => Model\Contact::getAccountType($contact['contact-type']), 'profile' => $profile, 'location' => $location_e, 'tags' => $contact['pub_keywords'], diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 833c616ab..94b1b1689 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -925,9 +925,9 @@ class DFRN foreach ($mentioned as $mention) { $condition = ['uid' => $owner["uid"], 'nurl' => Strings::normaliseLink($mention)]; - $contact = DBA::selectFirst('contact', ['forum', 'prv'], $condition); + $contact = DBA::selectFirst('contact', ['contact-type'], $condition); - if (DBA::isResult($contact) && ($contact["forum"] || $contact["prv"])) { + if (DBA::isResult($contact) && ($contact['contact-type'] == Contact::TYPE_COMMUNITY)) { XML::addElement( $doc, $entry, diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 2e1a2191c..014185c92 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -55,7 +55,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1450); + define('DB_UPDATE_VERSION', 1451); } return [ diff --git a/update.php b/update.php index 7b5f6778b..6e9c294c1 100644 --- a/update.php +++ b/update.php @@ -55,6 +55,7 @@ use Friendica\Model\Notification; use Friendica\Model\Photo; use Friendica\Model\Post; use Friendica\Model\Profile; +use Friendica\Model\User; use Friendica\Security\PermissionSet\Repository\PermissionSet; use Friendica\Worker\Delivery; @@ -1087,3 +1088,11 @@ function update_1446() return Update::SUCCESS; } + +function update_1451() +{ + DBA::update('user', ['account-type' => User::ACCOUNT_TYPE_COMMUNITY], ['page-flags' => [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]]); + DBA::update('contact', ['contact-type' => Contact::TYPE_COMMUNITY], ["`forum` OR `prv`"]); + + return Update::SUCCESS; +} From 6c156e3bc6eaaffd51ccc894fd8874da138f97d1 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 9 Feb 2022 07:02:06 +0000 Subject: [PATCH 009/170] Set "manually-approve" in the update --- update.php | 1 + 1 file changed, 1 insertion(+) diff --git a/update.php b/update.php index 6e9c294c1..016fe8a2e 100644 --- a/update.php +++ b/update.php @@ -1093,6 +1093,7 @@ function update_1451() { DBA::update('user', ['account-type' => User::ACCOUNT_TYPE_COMMUNITY], ['page-flags' => [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]]); DBA::update('contact', ['contact-type' => Contact::TYPE_COMMUNITY], ["`forum` OR `prv`"]); + DBA::update('contact', ['manually-approve' => true], ['prv' => true]); return Update::SUCCESS; } From 85eab6ebee301dd5351c1659121d341ba36e4764 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 9 Feb 2022 19:44:10 +0000 Subject: [PATCH 010/170] New field for groups that are connected with forums --- database.sql | 5 ++++- doc/database/db_group.md | 17 ++++++++++------- static/dbstructure.config.php | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/database.sql b/database.sql index 4237bcce3..ea129109d 100644 --- a/database.sql +++ b/database.sql @@ -644,10 +644,13 @@ CREATE TABLE IF NOT EXISTS `group` ( `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id', `visible` boolean NOT NULL DEFAULT '0' COMMENT '1 indicates the member list is not private', `deleted` boolean NOT NULL DEFAULT '0' COMMENT '1 indicates the group has been deleted', + `cid` int unsigned COMMENT 'Contact id of forum. When this field is filled then the members are synced automatically.', `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'human readable name of group', PRIMARY KEY(`id`), INDEX `uid` (`uid`), - FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE + INDEX `cid` (`cid`), + FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='privacy groups, group info'; -- diff --git a/doc/database/db_group.md b/doc/database/db_group.md index 1892de3e4..ad7fa4a3d 100644 --- a/doc/database/db_group.md +++ b/doc/database/db_group.md @@ -6,13 +6,14 @@ privacy groups, group info Fields ------ -| Field | Description | Type | Null | Key | Default | Extra | -| ------- | ------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- | -| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment | -| uid | Owner User id | mediumint unsigned | NO | | 0 | | -| visible | 1 indicates the member list is not private | boolean | NO | | 0 | | -| deleted | 1 indicates the group has been deleted | boolean | NO | | 0 | | -| name | human readable name of group | varchar(255) | NO | | | | +| Field | Description | Type | Null | Key | Default | Extra | +| ------- | ----------------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- | +| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment | +| uid | Owner User id | mediumint unsigned | NO | | 0 | | +| visible | 1 indicates the member list is not private | boolean | NO | | 0 | | +| deleted | 1 indicates the group has been deleted | boolean | NO | | 0 | | +| cid | Contact id of forum. When this field is filled then the members are synced automatically. | int unsigned | YES | | NULL | | +| name | human readable name of group | varchar(255) | NO | | | | Indexes ------------ @@ -21,6 +22,7 @@ Indexes | ------- | ------ | | PRIMARY | id | | uid | uid | +| cid | cid | Foreign Keys ------------ @@ -28,5 +30,6 @@ Foreign Keys | Field | Target Table | Target Field | |-------|--------------|--------------| | uid | [user](help/database/db_user) | uid | +| cid | [contact](help/database/db_contact) | id | Return to [database documentation](help/database) diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 014185c92..0cf854371 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -704,11 +704,13 @@ return [ "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"], "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"], "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"], + "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Contact id of forum. When this field is filled then the members are synced automatically."], "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"], ], "indexes" => [ "PRIMARY" => ["id"], "uid" => ["uid"], + "cid" => ["cid"], ] ], "group_member" => [ From 5b46b4122688e1c848083843e0d3aa84d6eba7ec Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 9 Feb 2022 21:34:25 +0000 Subject: [PATCH 011/170] New function to add group members from a forum --- src/Model/Group.php | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/Model/Group.php b/src/Model/Group.php index 17e0a18e2..390ed532e 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -29,6 +29,7 @@ use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Network\HTTPException; +use Friendica\Protocol\ActivityPub; /** * functions for interacting with the group database table @@ -519,4 +520,53 @@ class Group return $o; } + + /** + * Fetch the followers of a given contact id and store them as group members + * + * @param integer $id Contact ID + */ + public static function getMembersForForum(int $id) { + $contact = Contact::getById($id, ['uid', 'url', 'name']); + if (empty($contact)) { + return; + } + + $apcontact = APContact::getByURL($contact['url']); + if (empty($apcontact['followers'])) { + return; + } + + $group = DBA::selectFirst('group', ['id'], ['uid' => $contact['uid'], 'cid' => $id]); + if (empty($group)) { + $fields = [ + 'uid' => $contact['uid'], + 'name' => $contact['name'], + 'cid' => $id, + ]; + DBA::insert('group', $fields); + $gid = DBA::lastInsertId(); + } else { + $gid = $group['id']; + } + + $group_members = DBA::selectToArray('group_member', ['contact-id'], ['gid' => $gid]); + if (!empty($group_members)) { + $current = array_unique(array_column($group_members, 'contact-id')); + } else { + $current = []; + } + + foreach (ActivityPub::fetchItems($apcontact['followers']) as $follower) { + $id = Contact::getIdForURL($follower); + if (!in_array($id, $current)) { + DBA::insert('group_member', ['gid' => $gid, 'contact-id' => $id]); + } else { + $key = array_search($id, $current); + unset($current[$key]); + } + } + + DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $current]); + } } From d65357dd9281eaa9ed0dbd6e06f148f068b3f7c7 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 10 Feb 2022 09:04:48 +0100 Subject: [PATCH 012/170] added two help texts in the admin panel site config --- src/Module/Admin/Site.php | 4 +-- view/lang/C/messages.po | 66 ++++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 2bac3d79e..0f440f253 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -570,8 +570,8 @@ class Site extends BaseAdmin '$diaspora_not_able' => DI::l10n()->t('Diaspora support can\'t be enabled because Friendica was installed into a sub directory.'), '$diaspora_enabled' => ['diaspora_enabled', DI::l10n()->t('Enable Diaspora support'), DI::config()->get('system', 'diaspora_enabled', $diaspora_able), DI::l10n()->t('Enable built-in Diaspora network compatibility for communicating with diaspora servers.')], '$verifyssl' => ['verifyssl', DI::l10n()->t('Verify SSL'), DI::config()->get('system', 'verifyssl'), DI::l10n()->t('If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.')], - '$proxyuser' => ['proxyuser', DI::l10n()->t('Proxy user'), DI::config()->get('system', 'proxyuser'), ''], - '$proxy' => ['proxy', DI::l10n()->t('Proxy URL'), DI::config()->get('system', 'proxy'), ''], + '$proxyuser' => ['proxyuser', DI::l10n()->t('Proxy user'), DI::config()->get('system', 'proxyuser'), DI::l10n()->t('User name for the proxy server.')], + '$proxy' => ['proxy', DI::l10n()->t('Proxy URL'), DI::config()->get('system', 'proxy'), DI::l10n()->t('If you want to use a proxy server that Friendica should use to connect to the network, put the URL of the proxy here.')], '$timeout' => ['timeout', DI::l10n()->t('Network timeout'), DI::config()->get('system', 'curl_timeout'), DI::l10n()->t('Value is in seconds. Set to 0 for unlimited (not recommended).')], '$maxloadavg' => ['maxloadavg', DI::l10n()->t('Maximum Load Average'), DI::config()->get('system', 'maxloadavg'), DI::l10n()->t('Maximum system load before delivery and poll processes are deferred - default %d.', 20)], '$min_memory' => ['min_memory', DI::l10n()->t('Minimal Memory'), DI::config()->get('system', 'min_memory'), DI::l10n()->t('Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).')], diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 210eb0454..af98956ec 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.05-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-07 19:20+0000\n" +"POT-Creation-Date: 2022-02-10 09:02+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3169,7 +3169,7 @@ msgstr "" msgid "Local Directory" msgstr "" -#: src/Content/Widget.php:207 src/Model/Group.php:507 +#: src/Content/Widget.php:207 src/Model/Group.php:508 #: src/Module/Contact.php:354 src/Module/Welcome.php:76 msgid "Groups" msgstr "" @@ -3226,7 +3226,7 @@ msgstr "" msgid "Organisations" msgstr "" -#: src/Content/Widget.php:522 src/Model/Contact.php:1494 +#: src/Content/Widget.php:522 src/Model/Contact.php:1471 msgid "News" msgstr "" @@ -4059,71 +4059,71 @@ msgstr "" msgid "Approve" msgstr "" -#: src/Model/Contact.php:1490 +#: src/Model/Contact.php:1467 msgid "Organisation" msgstr "" -#: src/Model/Contact.php:1498 +#: src/Model/Contact.php:1475 msgid "Forum" msgstr "" -#: src/Model/Contact.php:2433 +#: src/Model/Contact.php:2410 msgid "Disallowed profile URL." msgstr "" -#: src/Model/Contact.php:2438 src/Module/Friendica.php:81 +#: src/Model/Contact.php:2415 src/Module/Friendica.php:81 msgid "Blocked domain" msgstr "" -#: src/Model/Contact.php:2443 +#: src/Model/Contact.php:2420 msgid "Connect URL missing." msgstr "" -#: src/Model/Contact.php:2452 +#: src/Model/Contact.php:2429 msgid "" "The contact could not be added. Please check the relevant network " "credentials in your Settings -> Social Networks page." msgstr "" -#: src/Model/Contact.php:2489 +#: src/Model/Contact.php:2466 msgid "The profile address specified does not provide adequate information." msgstr "" -#: src/Model/Contact.php:2491 +#: src/Model/Contact.php:2468 msgid "No compatible communication protocols or feeds were discovered." msgstr "" -#: src/Model/Contact.php:2494 +#: src/Model/Contact.php:2471 msgid "An author or name was not found." msgstr "" -#: src/Model/Contact.php:2497 +#: src/Model/Contact.php:2474 msgid "No browser URL could be matched to this address." msgstr "" -#: src/Model/Contact.php:2500 +#: src/Model/Contact.php:2477 msgid "" "Unable to match @-style Identity Address with a known protocol or email " "contact." msgstr "" -#: src/Model/Contact.php:2501 +#: src/Model/Contact.php:2478 msgid "Use mailto: in front of address to force email check." msgstr "" -#: src/Model/Contact.php:2507 +#: src/Model/Contact.php:2484 msgid "" "The profile address specified belongs to a network which has been disabled " "on this site." msgstr "" -#: src/Model/Contact.php:2512 +#: src/Model/Contact.php:2489 msgid "" "Limited profile. This person will be unable to receive direct/personal " "notifications from you." msgstr "" -#: src/Model/Contact.php:2571 +#: src/Model/Contact.php:2548 msgid "Unable to retrieve contact information." msgstr "" @@ -4199,47 +4199,47 @@ msgstr "" msgid "Happy Birthday %s" msgstr "" -#: src/Model/Group.php:94 +#: src/Model/Group.php:95 msgid "" "A deleted group with this name was revived. Existing item permissions " "may apply to this group and any future members. If this is " "not what you intended, please create another group with a different name." msgstr "" -#: src/Model/Group.php:423 +#: src/Model/Group.php:424 msgid "Default privacy group for new contacts" msgstr "" -#: src/Model/Group.php:455 +#: src/Model/Group.php:456 msgid "Everybody" msgstr "" -#: src/Model/Group.php:474 +#: src/Model/Group.php:475 msgid "edit" msgstr "" -#: src/Model/Group.php:506 +#: src/Model/Group.php:507 msgid "add" msgstr "" -#: src/Model/Group.php:511 +#: src/Model/Group.php:512 msgid "Edit group" msgstr "" -#: src/Model/Group.php:512 src/Module/Group.php:194 +#: src/Model/Group.php:513 src/Module/Group.php:194 msgid "Contacts not in any group" msgstr "" -#: src/Model/Group.php:514 +#: src/Model/Group.php:515 msgid "Create a new group" msgstr "" -#: src/Model/Group.php:515 src/Module/Group.php:179 src/Module/Group.php:202 +#: src/Model/Group.php:516 src/Module/Group.php:179 src/Module/Group.php:202 #: src/Module/Group.php:277 msgid "Group Name: " msgstr "" -#: src/Model/Group.php:516 +#: src/Model/Group.php:517 msgid "Edit groups" msgstr "" @@ -6027,10 +6027,20 @@ msgstr "" msgid "Proxy user" msgstr "" +#: src/Module/Admin/Site.php:573 +msgid "User name for the proxy server." +msgstr "" + #: src/Module/Admin/Site.php:574 msgid "Proxy URL" msgstr "" +#: src/Module/Admin/Site.php:574 +msgid "" +"If you want to use a proxy server that Friendica should use to connect to " +"the network, put the URL of the proxy here." +msgstr "" + #: src/Module/Admin/Site.php:575 msgid "Network timeout" msgstr "" From c0c17995084b9fc3067faa2f6fad77350680fbda Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 11 Feb 2022 13:47:06 +0100 Subject: [PATCH 013/170] Contact ex- and import should work with Misskey CSV files as well --- doc/Export-Import-Contacts.md | 2 +- doc/de/Export-Import-Contacts.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Export-Import-Contacts.md b/doc/Export-Import-Contacts.md index 3e1e91109..95b33f380 100644 --- a/doc/Export-Import-Contacts.md +++ b/doc/Export-Import-Contacts.md @@ -3,7 +3,7 @@ * [Home](help) In addition to [move your account](help/Move-Account) you can export and import the list of accounts you follow. -The exported list is stored as CSV file that is compatible to the format used by other platforms as e.g. Mastodon or Pleroma. +The exported list is stored as CSV file that is compatible to the format used by other platforms as e.g. Mastodon, Misskey or Pleroma. ## Export of followed Contacts diff --git a/doc/de/Export-Import-Contacts.md b/doc/de/Export-Import-Contacts.md index 73905567c..6d814edcb 100644 --- a/doc/de/Export-Import-Contacts.md +++ b/doc/de/Export-Import-Contacts.md @@ -3,7 +3,7 @@ * [Home](help) Zusätzlich zum [Umziehen des Accounts](help/Move-Account) kannst du die Liste der von dir gefolgten Kontakte exportieren und importieren. -Die exportierte Liste wird als CSV Datei in einem zu anderen Plattformen, z.B. Mastodon oder Pleroma, kompatiblen Format gespeichert. +Die exportierte Liste wird als CSV Datei in einem zu anderen Plattformen, z.B. Mastodon, Misskey oder Pleroma, kompatiblen Format gespeichert. ## Export der gefolgten Kontakte From a3ba3fb3835213c6fa9dbe373537a50e0f7b0615 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 12 Feb 2022 10:46:17 +0000 Subject: [PATCH 014/170] Simplify author contact fetching --- mod/display.php | 48 ++++++++---------------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/mod/display.php b/mod/display.php index 118645819..da41c8656 100644 --- a/mod/display.php +++ b/mod/display.php @@ -23,7 +23,6 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Widget; use Friendica\Core\Logger; -use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\Session; use Friendica\Database\DBA; @@ -36,6 +35,7 @@ use Friendica\Module\ActivityPub\Objects; use Friendica\Network\HTTPException; use Friendica\Protocol\ActivityPub; use Friendica\Protocol\DFRN; +use Friendica\Protocol\Diaspora; function display_init(App $a) { @@ -108,55 +108,23 @@ function display_init(App $a) $item = $parent ?: $item; } - $profiledata = display_fetchauthor($item); - - DI::page()['aside'] = Widget\VCard::getHTML($profiledata); + DI::page()['aside'] = Widget\VCard::getHTML(display_fetchauthor($item)); } function display_fetchauthor($item) { - $profiledata = Contact::getByURLForUser($item['author-link'], local_user()); - - // Check for a repeated message - $shared = Item::getShareArray($item); - if (!empty($shared) && empty($shared['comment'])) { - $profiledata = [ - 'uid' => 0, - 'id' => -1, - 'nickname' => '', - 'name' => '', - 'picdate' => '', - 'photo' => '', - 'url' => '', - 'network' => '', - ]; - - if (!empty($shared['author'])) { - $profiledata['name'] = $shared['author']; - } - + if (Diaspora::isReshare($item['body'], true)) { + $shared = Item::getShareArray($item); if (!empty($shared['profile'])) { - $profiledata['url'] = $shared['profile']; + $contact = Contact::getByURLForUser($shared['profile'], local_user()); } - - if (!empty($shared['avatar'])) { - $profiledata['photo'] = $shared['avatar']; - } - - $profiledata['nickname'] = $profiledata['name']; - $profiledata['network'] = Protocol::PHANTOM; - - $profiledata['address'] = ''; - $profiledata['about'] = ''; - - $profiledata = Contact::getByURLForUser($profiledata['url'], local_user()) ?: $profiledata; } - if (!empty($profiledata['photo'])) { - $profiledata['photo'] = DI::baseUrl()->remove($profiledata['photo']); + if (empty($contact)) { + $contact = Contact::getById($item['author-id']); } - return $profiledata; + return $contact; } function display_content(App $a, $update = false, $update_uid = 0) From cdee2b44dbab5a7cffe5c18db773624070bbcd98 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 12 Feb 2022 13:05:56 +0000 Subject: [PATCH 015/170] Avoid thread completion on activities --- src/Protocol/ActivityPub/Processor.php | 20 +++++++++++++++----- src/Protocol/ActivityPub/Receiver.php | 3 +++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 76f8cdb85..b7ddc09f6 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -306,7 +306,7 @@ class Processor } else { // Store the original actor in the "causer" fields to enable the check for ignored or blocked contacts $item['causer-link'] = $item['owner-link']; - $item['causer-id'] = $item['owner-id']; + $item['causer-id'] = $item['owner-id']; Logger::info('Use actor as causer.', ['id' => $item['owner-id'], 'actor' => $item['owner-link']]); } @@ -642,10 +642,16 @@ class Processor continue; } - if (!($item['isForum'] ?? false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT) && - ($item['post-reason'] == Item::PR_BCC) && !Contact::isSharingByURL($activity['author'], $receiver)) { - Logger::info('Top level post via BCC from a non sharer, ignoring', ['uid' => $receiver, 'contact' => $item['contact-id']]); - continue; + if (!($item['isForum'] ?? false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT) && !Contact::isSharingByURL($activity['author'], $receiver)) { + if ($item['post-reason'] == Item::PR_BCC) { + Logger::info('Top level post via BCC from a non sharer, ignoring', ['uid' => $receiver, 'contact' => $item['contact-id']]); + continue; + } + if (!empty($activity['thread-children-type']) && in_array($activity['thread-children-type'], Receiver::ACTIVITY_TYPES)) { + Logger::info('Top level post from thread completion from a non sharer had been initiated via an activity, ignoring', + ['type' => $activity['thread-children-type'], 'user' => $item['uid'], 'causer' => $item['causer-link'], 'author' => $activity['author'], 'url' => $item['uri']]); + continue; + } } $is_forum = false; @@ -887,6 +893,10 @@ class Processor $ldactivity['thread-completion'] = Contact::getIdForURL($actor); } + if (!empty($child['type'])) { + $ldactivity['thread-children-type'] = $child['type']; + } + if (!empty($relay_actor) && !self::acceptIncomingMessage($ldactivity, $object['id'])) { return ''; } diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index a28cc9617..3da53a033 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -515,6 +515,9 @@ class Receiver if (!empty($activity['thread-completion'])) { $object_data['thread-completion'] = $activity['thread-completion']; } + if (!empty($activity['thread-children-type'])) { + $object_data['thread-children-type'] = $activity['thread-children-type']; + } // Internal flag for posts that arrived via relay if (!empty($activity['from-relay'])) { From 6bc69f335368edd985ba312fce810a9a0e33b7fc Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 12 Feb 2022 18:27:58 +0100 Subject: [PATCH 016/170] Workaround for timing problems / Avoid a notice in the scheduled posts --- src/Object/Api/Mastodon/ScheduledStatus.php | 2 +- src/Util/HTTPSignature.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Object/Api/Mastodon/ScheduledStatus.php b/src/Object/Api/Mastodon/ScheduledStatus.php index e93c1c07b..759cd6e4e 100644 --- a/src/Object/Api/Mastodon/ScheduledStatus.php +++ b/src/Object/Api/Mastodon/ScheduledStatus.php @@ -71,7 +71,7 @@ class ScheduledStatus extends BaseDataTransferObject 'media_ids' => $media_ids, 'sensitive' => null, 'spoiler_text' => $parameters['item']['title'] ?? '', - 'visibility' => $visibility[$parameters['item']['private']], + 'visibility' => $visibility[$parameters['item']['private'] ?? 1], 'scheduled_at' => $this->scheduled_at, 'poll' => null, 'idempotency' => null, diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php index 7603b622b..68f6cb1dd 100644 --- a/src/Util/HTTPSignature.php +++ b/src/Util/HTTPSignature.php @@ -627,7 +627,8 @@ class HTTPSignature if (!empty($created)) { $current = time(); - if ($created > $current) { + // Calculate with a grace period of 60 seconds to avoid slight time differences between the servers + if (($created - 60) > $current) { Logger::notice('Signature created in the future', ['created' => date(DateTimeFormat::MYSQL, $created), 'expired' => date(DateTimeFormat::MYSQL, $expired), 'current' => date(DateTimeFormat::MYSQL, $current)]); return false; } From e394143148c63b73ad719cfb60b517bb20858b74 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 12 Feb 2022 18:38:36 +0000 Subject: [PATCH 017/170] Private forums are now working via ActivityPub --- database.sql | 4 +- doc/database/db_post-thread-user.md | 2 +- mod/item.php | 30 +++----- src/Model/Contact.php | 3 +- src/Model/Group.php | 62 ++++++++++----- src/Model/Item.php | 90 +++++++++------------- src/Module/Api/Twitter/Lists/Ownership.php | 2 +- src/Protocol/ActivityPub/Transmitter.php | 16 +--- src/Protocol/DFRN.php | 13 +--- src/Worker/Delivery.php | 1 - src/Worker/Notifier.php | 24 ------ static/dbstructure.config.php | 2 +- static/dbview.config.php | 2 - 13 files changed, 97 insertions(+), 154 deletions(-) diff --git a/database.sql b/database.sql index ea129109d..308e2e8a8 100644 --- a/database.sql +++ b/database.sql @@ -1277,7 +1277,7 @@ CREATE TABLE IF NOT EXISTS `post-thread-user` ( `wall` boolean NOT NULL DEFAULT '0' COMMENT 'This item was posted to the wall of uid', `mention` boolean NOT NULL DEFAULT '0' COMMENT '', `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '', - `forum_mode` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', + `forum_mode` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Deprecated', `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact.id', `unseen` boolean NOT NULL DEFAULT '1' COMMENT 'post has not been seen', `hidden` boolean NOT NULL DEFAULT '0' COMMENT 'Marker to hide the post from the user', @@ -1612,7 +1612,6 @@ CREATE VIEW `post-user-view` AS SELECT `post-user`.`deleted` AS `deleted`, `post-user`.`origin` AS `origin`, `post-thread-user`.`origin` AS `parent-origin`, - `post-thread-user`.`forum_mode` AS `forum_mode`, `post-thread-user`.`mention` AS `mention`, `post-user`.`global` AS `global`, `post-user`.`network` AS `network`, @@ -1773,7 +1772,6 @@ CREATE VIEW `post-thread-user-view` AS SELECT `post-thread-user`.`unseen` AS `unseen`, `post-user`.`deleted` AS `deleted`, `post-thread-user`.`origin` AS `origin`, - `post-thread-user`.`forum_mode` AS `forum_mode`, `post-thread-user`.`mention` AS `mention`, `post-user`.`global` AS `global`, `post-thread-user`.`network` AS `network`, diff --git a/doc/database/db_post-thread-user.md b/doc/database/db_post-thread-user.md index 7307dc78d..0b7483741 100644 --- a/doc/database/db_post-thread-user.md +++ b/doc/database/db_post-thread-user.md @@ -24,7 +24,7 @@ Fields | wall | This item was posted to the wall of uid | boolean | NO | | 0 | | | mention | | boolean | NO | | 0 | | | pubmail | | boolean | NO | | 0 | | -| forum_mode | | tinyint unsigned | NO | | 0 | | +| forum_mode | Deprecated | tinyint unsigned | NO | | 0 | | | contact-id | contact.id | int unsigned | NO | | 0 | | | unseen | post has not been seen | boolean | NO | | 1 | | | hidden | Marker to hide the post from the user | boolean | NO | | 0 | | diff --git a/mod/item.php b/mod/item.php index 7cf2e53d4..bc35282e3 100644 --- a/mod/item.php +++ b/mod/item.php @@ -29,7 +29,6 @@ */ use Friendica\App; -use Friendica\Content\Item as ItemHelper; use Friendica\Content\PageInfo; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; @@ -40,11 +39,11 @@ use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Model\APContact; use Friendica\Model\Attach; use Friendica\Model\Contact; use Friendica\Model\Conversation; use Friendica\Model\FileTag; +use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\ItemURI; use Friendica\Model\Notification; @@ -404,7 +403,7 @@ function item_post(App $a) { } $inform .= 'cid:' . $contact['id']; - if (!$toplevel_item_id || empty($contact['cid']) || ($contact['contact-type'] != Contact::TYPE_COMMUNITY)) { + if ($toplevel_item_id || empty($contact['cid']) || ($contact['contact-type'] != Contact::TYPE_COMMUNITY)) { continue; } @@ -437,26 +436,15 @@ function item_post(App $a) { $postopts = ''; } - if (!$private_forum) { + $str_contact_deny = ''; + $str_group_deny = ''; + + if ($private_forum) { + $str_contact_allow = '<' . $private_id . '>'; + $str_group_allow = '<' . Group::getIdForForum($forum_contact['id']) . '>'; + } else { $str_contact_allow = ''; $str_group_allow = ''; - $str_contact_deny = ''; - $str_group_deny = ''; - } - - if ($private_forum || !APContact::getByURL($forum_contact['url'])) { - $str_group_allow = ''; - $str_contact_deny = ''; - $str_group_deny = ''; - if ($private_forum) { - $str_contact_allow = '<' . $private_id . '>'; - } else { - $str_contact_allow = ''; - } - $contact_id = $private_id; - $contact_record = $forum_contact; - $_REQUEST['origin'] = false; - $wall = 0; } } diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 1b39247f4..d80827c93 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -685,7 +685,7 @@ class Contact */ public static function updateSelfFromUserID($uid, $update_avatar = false) { - $fields = ['id', 'name', 'nick', 'location', 'about', 'keywords', 'avatar', 'prvkey', 'pubkey', + $fields = ['id', 'name', 'nick', 'location', 'about', 'keywords', 'avatar', 'prvkey', 'pubkey', 'manually-approve', 'xmpp', 'matrix', 'contact-type', 'forum', 'prv', 'avatar-date', 'url', 'nurl', 'unsearchable', 'photo', 'thumb', 'micro', 'header', 'addr', 'request', 'notify', 'poll', 'confirm', 'poco', 'network']; $self = DBA::selectFirst('contact', $fields, ['uid' => $uid, 'self' => true]); @@ -757,6 +757,7 @@ class Contact $fields['forum'] = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY; $fields['prv'] = $user['page-flags'] == User::PAGE_FLAGS_PRVGROUP; $fields['unsearchable'] = !$profile['net-publish']; + $fields['manually-approve'] = in_array($user['page-flags'], [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_PRVGROUP]); $update = false; diff --git a/src/Model/Group.php b/src/Model/Group.php index 390ed532e..b9f4c7f27 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -41,7 +41,7 @@ class Group public static function getByUserId($uid, $includesDeleted = false) { - $conditions = ['uid' => $uid]; + $conditions = ['uid' => $uid, 'cid' => null]; if (!$includesDeleted) { $conditions['deleted'] = false; @@ -408,7 +408,7 @@ class Group ] ]; - $stmt = DBA::select('group', [], ['deleted' => 0, 'uid' => $uid], ['order' => ['name']]); + $stmt = DBA::select('group', [], ['deleted' => false, 'uid' => $uid, 'cid' => null], ['order' => ['name']]); while ($group = DBA::fetch($stmt)) { $display_groups[] = [ 'name' => $group['name'], @@ -465,7 +465,7 @@ class Group $member_of = self::getIdsByContactId($cid); } - $stmt = DBA::select('group', [], ['deleted' => 0, 'uid' => local_user()], ['order' => ['name']]); + $stmt = DBA::select('group', [], ['deleted' => false, 'uid' => local_user(), 'cid' => null], ['order' => ['name']]); while ($group = DBA::fetch($stmt)) { $selected = (($group_id == $group['id']) ? ' group-selected' : ''); @@ -522,21 +522,19 @@ class Group } /** - * Fetch the followers of a given contact id and store them as group members + * Fetch the group id for the given contact id * * @param integer $id Contact ID + * @return integer Group IO */ - public static function getMembersForForum(int $id) { - $contact = Contact::getById($id, ['uid', 'url', 'name']); - if (empty($contact)) { - return; + public static function getIdForForum(int $id) + { + Logger::info('Get id for forum id', ['id' => $id]); + $contact = Contact::getById($id, ['uid', 'name', 'contact-type', 'manually-approve']); + if (empty($contact) || ($contact['contact-type'] != Contact::TYPE_COMMUNITY) || !$contact['manually-approve']) { + return 0; } - - $apcontact = APContact::getByURL($contact['url']); - if (empty($apcontact['followers'])) { - return; - } - + $group = DBA::selectFirst('group', ['id'], ['uid' => $contact['uid'], 'cid' => $id]); if (empty($group)) { $fields = [ @@ -549,15 +547,42 @@ class Group } else { $gid = $group['id']; } - + + return $gid; + } + + /** + * Fetch the followers of a given contact id and store them as group members + * + * @param integer $id Contact ID + */ + public static function getMembersForForum(int $id) + { + Logger::info('Update forum members', ['id' => $id]); + + $contact = Contact::getById($id, ['uid', 'url']); + if (empty($contact)) { + return; + } + + $apcontact = APContact::getByURL($contact['url']); + if (empty($apcontact['followers'])) { + return; + } + + $gid = self::getIdForForum($id); + if (empty($gid)) { + return; + } + $group_members = DBA::selectToArray('group_member', ['contact-id'], ['gid' => $gid]); if (!empty($group_members)) { $current = array_unique(array_column($group_members, 'contact-id')); } else { $current = []; } - - foreach (ActivityPub::fetchItems($apcontact['followers']) as $follower) { + + foreach (ActivityPub::fetchItems($apcontact['followers'], $contact['uid']) as $follower) { $id = Contact::getIdForURL($follower); if (!in_array($id, $current)) { DBA::insert('group_member', ['gid' => $gid, 'contact-id' => $id]); @@ -566,7 +591,8 @@ class Group unset($current[$key]); } } - + DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $current]); + Logger::info('Updated forum members', ['id' => $id, 'count' => DBA::count('group_member', ['gid' => $gid])]); } } diff --git a/src/Model/Item.php b/src/Model/Item.php index bf1f2585a..6749dc238 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -100,7 +100,7 @@ class Item 'inform', 'deleted', 'extid', 'post-type', 'post-reason', 'gravity', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'author-id', 'author-link', 'author-name', 'author-avatar', 'owner-id', 'owner-link', 'contact-uid', - 'signed_text', 'network', 'wall', 'contact-id', 'plink', 'forum_mode', 'origin', + 'signed_text', 'network', 'wall', 'contact-id', 'plink', 'origin', 'thr-parent-id', 'parent-uri-id', 'postopts', 'pubmail', 'event-created', 'event-edited', 'event-start', 'event-finish', 'event-summary', 'event-desc', 'event-location', 'event-type', @@ -114,7 +114,7 @@ class Item 'postopts', 'plink', 'resource-id', 'event-id', 'inform', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'post-type', 'post-reason', 'private', 'pubmail', 'visible', 'starred', - 'unseen', 'deleted', 'origin', 'forum_mode', 'mention', 'global', 'network', + 'unseen', 'deleted', 'origin', 'mention', 'global', 'network', 'title', 'content-warning', 'body', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object-type', 'object', 'target-type', 'target', 'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network', @@ -655,7 +655,7 @@ class Item $fields = ['uid', 'uri', 'parent-uri', 'id', 'deleted', 'uri-id', 'parent-uri-id', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', - 'wall', 'private', 'forum_mode', 'origin', 'author-id']; + 'wall', 'private', 'origin', 'author-id']; $condition = ['uri-id' => $item['thr-parent-id'], 'uid' => $item['uid']]; $params = ['order' => ['id' => false]]; $parent = Post::selectFirst($fields, $condition, $params); @@ -881,10 +881,15 @@ class Item $item['parent-uri'] = $toplevel_parent['uri']; $item['parent-uri-id'] = $toplevel_parent['uri-id']; $item['deleted'] = $toplevel_parent['deleted']; - $item['allow_cid'] = $toplevel_parent['allow_cid']; - $item['allow_gid'] = $toplevel_parent['allow_gid']; - $item['deny_cid'] = $toplevel_parent['deny_cid']; - $item['deny_gid'] = $toplevel_parent['deny_gid']; + + // Reshares have to keep their permissions to allow forums to work + if (!$item['origin'] || ($item['verb'] != Activity::ANNOUNCE)) { + $item['allow_cid'] = $toplevel_parent['allow_cid']; + $item['allow_gid'] = $toplevel_parent['allow_gid']; + $item['deny_cid'] = $toplevel_parent['deny_cid']; + $item['deny_gid'] = $toplevel_parent['deny_gid']; + } + $parent_origin = $toplevel_parent['origin']; // Don't federate received participation messages @@ -905,15 +910,6 @@ class Item $item['private'] = $toplevel_parent['private']; } - /* - * Edge case. We host a public forum that was originally posted to privately. - * The original author commented, but as this is a comment, the permissions - * weren't fixed up so it will still show the comment as private unless we fix it here. - */ - if ((intval($toplevel_parent['forum_mode']) == 1) && ($toplevel_parent['private'] != self::PUBLIC)) { - $item['private'] = self::PUBLIC; - } - // If its a post that originated here then tag the thread as "mention" if ($item['origin'] && $item['uid']) { DBA::update('post-thread-user', ['mention' => true], ['uri-id' => $item['parent-uri-id'], 'uid' => $item['uid']]); @@ -1451,7 +1447,6 @@ class Item unset($item['pinned']); unset($item['ignored']); unset($item['pubmail']); - unset($item['forum_mode']); unset($item['event-id']); unset($item['hidden']); @@ -1928,41 +1923,18 @@ class Item Logger::info('Community post will be distributed', ['uri' => $item['uri'], 'uid' => $uid, 'id' => $item_id, 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]); - self::performActivity($item['id'], 'announce', $uid); + if ($owner['page-flags'] == User::PAGE_FLAGS_PRVGROUP) { + Group::getMembersForForum($owner['id']); - /** - * All the following lines are only needed for private forums and compatibility to older systems without AP support. - * A possible way would be that the followers list of a forum would always be readable by all followers. - * So this would mean that the comment distribution could be done exactly for the intended audience. - * Or possibly we could store the receivers that had been in the "announce" message above and use this. - */ - - // also reset all the privacy bits to the forum default permissions - if ($owner['allow_cid'] || $owner['allow_gid'] || $owner['deny_cid'] || $owner['deny_gid']) { - $private = self::PRIVATE; - } elseif (DI::pConfig()->get($owner['uid'], 'system', 'unlisted')) { - $private = self::UNLISTED; + $allow_cid = '<' . $owner['id'] . '>'; + $allow_gid = '<' . Group::getIdForForum($owner['id']) . '>'; + $deny_cid = ''; + $deny_gid = ''; + self::performActivity($item['id'], 'announce', $uid, $allow_cid, $allow_gid, $deny_cid, $deny_gid); } else { - $private = self::PUBLIC; + self::performActivity($item['id'], 'announce', $uid); } - $permissionSet = DI::permissionSet()->selectOrCreate( - DI::permissionSetFactory()->createFromString( - $owner['uid'], - $owner['allow_cid'], - $owner['allow_gid'], - $owner['deny_cid'], - $owner['deny_gid'] - )); - - $forum_mode = ($owner['page-flags'] == User::PAGE_FLAGS_PRVGROUP) ? 2 : 1; - - $fields = ['wall' => true, 'origin' => true, 'forum_mode' => $forum_mode, 'contact-id' => $owner['id'], - 'owner-id' => Contact::getPublicIdByUserId($uid), 'private' => $private, 'psid' => $permissionSet->id]; - self::update($fields, ['id' => $item['id']]); - - Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'Notifier', Delivery::POST, (int)$item['uri-id'], (int)$item['uid']); - Logger::info('Community post had been distributed', ['uri' => $item['uri'], 'uid' => $uid, 'id' => $item_id, 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]); return false; } @@ -2325,12 +2297,17 @@ class Item * * Toggle activities as like,dislike,attend of an item * - * @param int $item_id + * @param int $item_id * @param string $verb * Activity verb. One of * like, unlike, dislike, undislike, attendyes, unattendyes, * attendno, unattendno, attendmaybe, unattendmaybe, * announce, unannouce + * @param int $uid + * @param string $allow_cid + * @param string $allow_gid + * @param string $deny_cid + * @param string $deny_gid * @return bool * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException @@ -2338,7 +2315,7 @@ class Item * array $arr * 'post_id' => ID of posted item */ - public static function performActivity(int $item_id, string $verb, int $uid) + public static function performActivity(int $item_id, string $verb, int $uid, string $allow_cid = null, string $allow_gid = null, string $deny_cid = null, string $deny_gid = null) { if (empty($uid)) { return false; @@ -2479,6 +2456,11 @@ class Item return true; } + $allow_cid = $allow_cid ?? $item['allow_cid']; + $allow_gid = $allow_gid ?? $item['allow_gid']; + $deny_cid = $deny_cid ?? $item['deny_cid']; + $deny_gid = $deny_gid ?? $item['deny_gid']; + $objtype = $item['resource-id'] ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE; $new_item = [ @@ -2499,10 +2481,10 @@ class Item 'body' => $activity, 'verb' => $activity, 'object-type' => $objtype, - 'allow_cid' => $item['allow_cid'], - 'allow_gid' => $item['allow_gid'], - 'deny_cid' => $item['deny_cid'], - 'deny_gid' => $item['deny_gid'], + 'allow_cid' => $allow_cid, + 'allow_gid' => $allow_gid, + 'deny_cid' => $deny_cid, + 'deny_gid' => $deny_gid, 'visible' => 1, 'unseen' => 1, ]; diff --git a/src/Module/Api/Twitter/Lists/Ownership.php b/src/Module/Api/Twitter/Lists/Ownership.php index e5aca1ad5..c3ff0030b 100644 --- a/src/Module/Api/Twitter/Lists/Ownership.php +++ b/src/Module/Api/Twitter/Lists/Ownership.php @@ -56,7 +56,7 @@ class Ownership extends BaseApi BaseApi::checkAllowedScope(BaseApi::SCOPE_READ); $uid = BaseApi::getCurrentUserID(); - $groups = $this->dba->select('group', [], ['deleted' => false, 'uid' => $uid]); + $groups = $this->dba->select('group', [], ['deleted' => false, 'uid' => $uid, 'cid' => null]); // loop through all groups $lists = []; diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index aafeee1e2..663862f79 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -184,7 +184,7 @@ class Transmitter // Allow fetching the contact list when the requester is part of the list. if (($owner['page-flags'] == User::PAGE_FLAGS_PRVGROUP) && !empty($requester)) { - $show_contacts = DBA::exists('contact', ['nurl' => Strings::normaliseLink($requester), 'rel' => $rel]); + $show_contacts = DBA::exists('contact', ['nurl' => Strings::normaliseLink($requester), 'uid' => $owner['uid'], 'blocked' => false]); } if (!$show_contacts) { @@ -1079,20 +1079,6 @@ class Transmitter return false; } - // In case of a forum post ensure to return the original post if author and forum are on the same machine - if (($item['gravity'] == GRAVITY_PARENT) && !empty($item['forum_mode'])) { - $author = Contact::getById($item['author-id'], ['nurl']); - if (!empty($author['nurl'])) { - $self = Contact::selectFirst(['uid'], ['nurl' => $author['nurl'], 'self' => true]); - if (!empty($self['uid'])) { - $forum_item = Post::selectFirst(Item::DELIVER_FIELDLIST, ['uri-id' => $item['uri-id'], 'uid' => $self['uid']]); - if (DBA::isResult($forum_item)) { - $item = $forum_item; - } - } - } - } - if (empty($item['uri-id'])) { Logger::warning('Item without uri-id', ['item' => $item]); return false; diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 94b1b1689..50faf987a 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1557,22 +1557,11 @@ class DFRN // was the top-level post for this action written by somebody on this site? // Specifically, the recipient? - $parent = Post::selectFirst(['forum_mode', 'wall'], + $parent = Post::selectFirst(['wall'], ["`uri` = ? AND `uid` = ?" . $sql_extra, $item["thr-parent"], $importer["importer_uid"]]); $is_a_remote_action = DBA::isResult($parent); - /* - * Does this have the characteristics of a community or private group action? - * If it's an action to a wall post on a community/prvgroup page it's a - * valid community action. Also forum_mode makes it valid for sure. - * If neither, it's not. - */ - if ($is_a_remote_action && $community && (!$parent["forum_mode"]) && (!$parent["wall"])) { - $is_a_remote_action = false; - Logger::notice("not a community action"); - } - if ($is_a_remote_action) { return DFRN::REPLY_RC; } else { diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 3be49a38f..c09181d3e 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -46,7 +46,6 @@ class Delivery const DELETION = 'drop'; const POST = 'wall-new'; const POKE = 'poke'; - const UPLINK = 'uplink'; const REMOVAL = 'removeme'; const PROFILEUPDATE = 'profileupdate'; diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index f46b1b0d9..bfd38fe01 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -223,10 +223,6 @@ class Notifier $relay_to_owner = true; } - if (($cmd === Delivery::UPLINK) && (intval($parent['forum_mode']) == 1) && !$top_level) { - $relay_to_owner = true; - } - // until the 'origin' flag has been in use for several months // we will just use it as a fallback test // later we will be able to use it as the primary test of whether or not to relay. @@ -333,15 +329,6 @@ class Notifier $deny_people = $aclFormatter->expand($parent['deny_cid']); $deny_groups = Group::expand($uid, $aclFormatter->expand($parent['deny_gid'])); - // if our parent is a public forum (forum_mode == 1), uplink to the origional author causing - // a delivery fork. private groups (forum_mode == 2) do not uplink - /// @todo Possibly we should not uplink when the author is the forum itself? - - if ((intval($parent['forum_mode']) == 1) && !$top_level && ($cmd !== Delivery::UPLINK) - && ($target_item['verb'] != Activity::ANNOUNCE)) { - Worker::add($a->getQueueValue('priority'), 'Notifier', Delivery::UPLINK, $post_uriid, $sender_uid); - } - foreach ($items as $item) { $recipients[] = $item['contact-id']; // pull out additional tagged people to notify (if public message) @@ -813,15 +800,4 @@ class Notifier return ['count' => $delivery_queue_count, 'contacts' => $contacts]; } - - /** - * Check if the delivered item is a forum post - * - * @param array $item - * @return boolean - */ - public static function isForumPost(array $item) - { - return ($item['gravity'] == GRAVITY_PARENT) && !empty($item['forum_mode']); - } } diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 0cf854371..01419bf2b 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1301,7 +1301,7 @@ return [ "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"], "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Deprecated"], "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"], "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"], "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"], diff --git a/static/dbview.config.php b/static/dbview.config.php index 4188c7726..014973de2 100644 --- a/static/dbview.config.php +++ b/static/dbview.config.php @@ -91,7 +91,6 @@ "deleted" => ["post-user", "deleted"], "origin" => ["post-user", "origin"], "parent-origin" => ["post-thread-user", "origin"], - "forum_mode" => ["post-thread-user", "forum_mode"], "mention" => ["post-thread-user", "mention"], "global" => ["post-user", "global"], "network" => ["post-user", "network"], @@ -250,7 +249,6 @@ "unseen" => ["post-thread-user", "unseen"], "deleted" => ["post-user", "deleted"], "origin" => ["post-thread-user", "origin"], - "forum_mode" => ["post-thread-user", "forum_mode"], "mention" => ["post-thread-user", "mention"], "global" => ["post-user", "global"], "network" => ["post-thread-user", "network"], From ee3a8ccb3bbb4c214f7410976bd9f6ae95be40f1 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 13 Feb 2022 05:45:06 +0000 Subject: [PATCH 018/170] No notifcations for forum / fetch user for fetching content --- src/Model/Post/UserNotification.php | 6 +++++ src/Protocol/ActivityPub/Receiver.php | 37 ++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/Model/Post/UserNotification.php b/src/Model/Post/UserNotification.php index ad7b9c490..79499897d 100644 --- a/src/Model/Post/UserNotification.php +++ b/src/Model/Post/UserNotification.php @@ -33,6 +33,7 @@ use Friendica\Model\Contact; use Friendica\Model\Post; use Friendica\Model\Subscription; use Friendica\Model\Tag; +use Friendica\Model\User; use Friendica\Navigation\Notifications; use Friendica\Network\HTTPException; use Friendica\Protocol\Activity; @@ -176,6 +177,11 @@ class UserNotification return; } + $user = User::getById($uid, ['account-type']); + if (in_array($user['account-type'], [User::ACCOUNT_TYPE_COMMUNITY, User::ACCOUNT_TYPE_RELAY])) { + return; + } + $notification_type = self::TYPE_NONE; if (self::checkShared($item, $uid)) { diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 3da53a033..3d183aec5 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -263,7 +263,19 @@ class Receiver { $id = JsonLD::fetchElement($activity, '@id'); if (!empty($id) && !$trust_source) { - $fetched_activity = ActivityPub::fetchContent($id, $uid ?? 0); + if (empty($uid)) { + $actor = JsonLD::fetchElement($activity, 'as:actor', '@id'); + if (empty($actor)) { + $actor = ''; + } + + // Fetch a user out of the receivers of the message. + $fetch_uid = Receiver::getBestUserForActivity($activity, $actor); + } else { + $fetch_uid = $uid; + } + + $fetched_activity = ActivityPub::fetchContent($id, $fetch_uid); if (!empty($fetched_activity)) { $object = JsonLD::compact($fetched_activity); $fetched_id = JsonLD::fetchElement($object, '@id'); @@ -643,6 +655,29 @@ class Receiver } } + /** + * Fetch a user id from an activity array + * + * @param array $activity + * @param string $actor + * + * @return int user id + */ + private static function getBestUserForActivity(array $activity, string $actor) + { + $uid = 0; + $receivers = self::getReceivers($activity, $actor); + foreach ($receivers as $receiver) { + if ($receiver['type'] == self::TARGET_GLOBAL) { + return 0; + } + if (empty($uid) || ($receiver['type'] == self::TARGET_TO)) { + $uid = $receiver['uid']; + } + } + return $uid; + } + /** * Fetch the receiver list from an activity array * From a5a1c8179059a66886809dcfdfd8eb67f6c24828 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 13 Feb 2022 16:42:43 +0000 Subject: [PATCH 019/170] Fetch the user id when not provided --- src/Protocol/ActivityPub/Receiver.php | 34 ++++++++++----------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 3d183aec5..7f08410f6 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -263,17 +263,7 @@ class Receiver { $id = JsonLD::fetchElement($activity, '@id'); if (!empty($id) && !$trust_source) { - if (empty($uid)) { - $actor = JsonLD::fetchElement($activity, 'as:actor', '@id'); - if (empty($actor)) { - $actor = ''; - } - - // Fetch a user out of the receivers of the message. - $fetch_uid = Receiver::getBestUserForActivity($activity, $actor); - } else { - $fetch_uid = $uid; - } + $fetch_uid = $uid ?: self::getBestUserForActivity($activity); $fetched_activity = ActivityPub::fetchContent($id, $fetch_uid); if (!empty($fetched_activity)) { @@ -314,12 +304,12 @@ class Receiver if (empty($activity['thread-completion']) && (empty($reception_types[$uid]) || in_array($reception_types[$uid], [self::TARGET_UNKNOWN, self::TARGET_FOLLOWER, self::TARGET_ANSWER, self::TARGET_GLOBAL]))) { $reception_types[$uid] = self::TARGET_BCC; } - } else { - // We possibly need some user to fetch private content, - // so we fetch the first out ot the list. - $uid = self::getFirstUserFromReceivers($receivers); } + // We possibly need some user to fetch private content, + // so we fetch one out of the receivers if no uid is provided. + $fetch_uid = $uid ?: self::getBestUserForActivity($activity); + $object_id = JsonLD::fetchElement($activity, 'as:object', '@id'); if (empty($object_id)) { Logger::info('No object found'); @@ -331,11 +321,11 @@ class Receiver return []; } - $object_type = self::fetchObjectType($activity, $object_id, $uid); + $object_type = self::fetchObjectType($activity, $object_id, $fetch_uid); // Fetch the activity on Lemmy "Announce" messages (announces of activities) if (($type == 'as:Announce') && in_array($object_type, array_merge(self::ACTIVITY_TYPES, ['as:Delete', 'as:Undo', 'as:Update']))) { - $data = ActivityPub::fetchContent($object_id, $uid); + $data = ActivityPub::fetchContent($object_id, $fetch_uid); if (!empty($data)) { $type = $object_type; $activity = JsonLD::compact($data); @@ -343,7 +333,7 @@ class Receiver // Some variables need to be refetched since the activity changed $actor = JsonLD::fetchElement($activity, 'as:actor', '@id'); $object_id = JsonLD::fetchElement($activity, 'as:object', '@id'); - $object_type = self::fetchObjectType($activity, $object_id, $uid); + $object_type = self::fetchObjectType($activity, $object_id, $fetch_uid); } } @@ -360,7 +350,7 @@ class Receiver // Fetch the content only on activities where this matters // We can receive "#emojiReaction" when fetching content from Hubzilla systems // Always fetch on "Announce" - $object_data = self::fetchObject($object_id, $activity['as:object'], $trust_source && ($type != 'as:Announce'), $uid); + $object_data = self::fetchObject($object_id, $activity['as:object'], $trust_source && ($type != 'as:Announce'), $fetch_uid); if (empty($object_data)) { Logger::info("Object data couldn't be processed"); return []; @@ -408,7 +398,7 @@ class Receiver // An Undo is done on the object of an object, so we need that type as well if (($type == 'as:Undo') && !empty($object_data['object_object'])) { - $object_data['object_object_type'] = self::fetchObjectType([], $object_data['object_object'], $uid); + $object_data['object_object_type'] = self::fetchObjectType([], $object_data['object_object'], $fetch_uid); } } @@ -663,9 +653,11 @@ class Receiver * * @return int user id */ - private static function getBestUserForActivity(array $activity, string $actor) + public static function getBestUserForActivity(array $activity) { $uid = 0; + $actor = JsonLD::fetchElement($activity, 'as:actor', '@id') ?? ''; + $receivers = self::getReceivers($activity, $actor); foreach ($receivers as $receiver) { if ($receiver['type'] == self::TARGET_GLOBAL) { From d404f15312320dbe1f516db7bb91944182ad5d26 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 14 Feb 2022 22:04:33 +0000 Subject: [PATCH 020/170] Improve local forum distribution --- src/Model/Item.php | 52 ++++++++++++++++++++++-- src/Protocol/ActivityPub/Transmitter.php | 31 +++++++++----- 2 files changed, 69 insertions(+), 14 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 6749dc238..fd0dbde2b 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1402,9 +1402,15 @@ class Item } if ((($item['gravity'] == GRAVITY_COMMENT) || $is_reshare) && !Post::exists(['uri-id' => $item['thr-parent-id'], 'uid' => $uid])) { - // Only do an auto complete with the source uid "0" to prevent privavy problems + // Fetch the origin user for the post + $origin_uid = self::GetOriginUidForUriId($item['thr-parent-id'], $uid); + if (is_null($origin_uid)) { + Logger::info('Origin item was not found', ['uid' => $uid, 'uri-id' => $item['thr-parent-id']]); + return 0; + } + $causer = $item['causer-id'] ?: $item['author-id']; - $result = self::storeForUserByUriId($item['thr-parent-id'], $uid, ['causer-id' => $causer, 'post-reason' => self::PR_FETCHED]); + $result = self::storeForUserByUriId($item['thr-parent-id'], $uid, ['causer-id' => $causer, 'post-reason' => self::PR_FETCHED], $origin_uid); Logger::info('Fetched thread parent', ['uri-id' => $item['thr-parent-id'], 'uid' => $uid, 'causer' => $causer, 'result' => $result]); } @@ -1413,6 +1419,46 @@ class Item return $stored; } + /** + * Returns the origin uid of a post if the given user is allowed to see it. + * + * @param int $uriid + * @param int $uid + * @return int + */ + private static function GetOriginUidForUriId(int $uriid, int $uid) + { + if (Post::exists(['uri-id' => $uriid, 'uid' => $uid])) { + return $uid; + } + + $post = Post::selectFirst(['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'private'], ['uri-id' => $uriid, 'origin' => true]); + if (empty($post)) { + if (Post::exists(['uri-id' => $uriid, 'uid' => 0])) { + return 0; + } else { + return null; + } + } + + if (in_array($post['private'], [Item::PUBLIC, Item::UNLISTED])) { + return $post['uid']; + } + + $pcid = Contact::getPublicIdByUserId($uid); + if (empty($pcid)) { + return null; + } + + foreach (Item::enumeratePermissions($post, true) as $receiver) { + if ($receiver == $pcid) { + return $post['uid']; + } + } + + return null; + } + /** * Store a public item array for the given users * @@ -1928,7 +1974,7 @@ class Item $allow_cid = '<' . $owner['id'] . '>'; $allow_gid = '<' . Group::getIdForForum($owner['id']) . '>'; - $deny_cid = ''; + $deny_cid = ''; $deny_gid = ''; self::performActivity($item['id'], 'announce', $uid, $allow_cid, $allow_gid, $deny_cid, $deny_gid); } else { diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 663862f79..7be55898c 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -600,23 +600,32 @@ class Transmitter continue; } - if (!empty($profile = APContact::getByURL($contact['url'], false))) { + $profile = APContact::getByURL($term['url'], false); + if (!empty($profile)) { + if ($term['type'] == Tag::EXCLUSIVE_MENTION) { + $exclusive = true; + if (!empty($profile['followers']) && ($profile['type'] == 'Group')) { + $data['cc'][] = $profile['followers']; + } + } $data['to'][] = $profile['url']; } } } - foreach ($receiver_list as $receiver) { - $contact = DBA::selectFirst('contact', ['url', 'hidden', 'network', 'protocol', 'gsid'], ['id' => $receiver, 'network' => Protocol::FEDERATED]); - if (!DBA::isResult($contact) || !self::isAPContact($contact, $networks)) { - continue; - } + if (!$exclusive) { + foreach ($receiver_list as $receiver) { + $contact = DBA::selectFirst('contact', ['url', 'hidden', 'network', 'protocol', 'gsid'], ['id' => $receiver, 'network' => Protocol::FEDERATED]); + if (!DBA::isResult($contact) || !self::isAPContact($contact, $networks)) { + continue; + } - if (!empty($profile = APContact::getByURL($contact['url'], false))) { - if ($contact['hidden'] || $always_bcc) { - $data['bcc'][] = $profile['url']; - } else { - $data['cc'][] = $profile['url']; + if (!empty($profile = APContact::getByURL($contact['url'], false))) { + if ($contact['hidden'] || $always_bcc) { + $data['bcc'][] = $profile['url']; + } else { + $data['cc'][] = $profile['url']; + } } } } From 31ff583c5ed1a0a70b50d5e6e9521fe048b0ab41 Mon Sep 17 00:00:00 2001 From: k-alin <63866963+k-alin@users.noreply.github.com> Date: Mon, 14 Feb 2022 23:18:41 +0100 Subject: [PATCH 021/170] mysql connection via unix sockets (mysqli + PDO) --- src/Database/Database.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Database/Database.php b/src/Database/Database.php index f478d7993..effed6e5e 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -114,6 +114,7 @@ class Database $pass = trim($this->configCache->get('database', 'password')); $db = trim($this->configCache->get('database', 'database')); $charset = trim($this->configCache->get('database', 'charset')); + $socket = trim($this->configCache->get('database', 'socket')); if (!(strlen($server) && strlen($user))) { return false; @@ -125,7 +126,7 @@ class Database if (!$this->configCache->get('database', 'disable_pdo') && class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) { $this->driver = self::PDO; - $connect = "mysql:host=" . $server . ";dbname=" . $db; + $connect = "mysql:host=" . $server . ";dbname=" . $db . ";unix_socket=" . $socket; if ($port > 0) { $connect .= ";port=" . $port; @@ -149,9 +150,9 @@ class Database $this->driver = self::MYSQLI; if ($port > 0) { - $this->connection = @new mysqli($server, $user, $pass, $db, $port); + $this->connection = @new mysqli($server, $user, $pass, $db, $port, $socket); } else { - $this->connection = @new mysqli($server, $user, $pass, $db); + $this->connection = @new mysqli($server, $user, $pass, $db, $socket); } if (!mysqli_connect_errno()) { From 2b0518ac04b31fd37e617723d6492149aaa7e06f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Feb 2022 06:21:46 +0000 Subject: [PATCH 022/170] unset several table fields before distribution --- src/Model/Item.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index fd0dbde2b..46f41e9a9 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1485,6 +1485,7 @@ class Item return 0; } + // Data from the "post-user" table unset($item['id']); unset($item['mention']); unset($item['starred']); @@ -1493,10 +1494,14 @@ class Item unset($item['pinned']); unset($item['ignored']); unset($item['pubmail']); - unset($item['event-id']); unset($item['hidden']); unset($item['notification-type']); + unset($item['post-reason']); + + // Data from the "post-delivery-data" table + unset($item['postopts']); + unset($item['inform']); $item['uid'] = $uid; $item['origin'] = 0; From 29d83c0ffb135a0cec8c6ad5fc2a80fbdd96683f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Feb 2022 07:08:02 +0000 Subject: [PATCH 023/170] Block communication with Diaspora for communities --- src/Model/Item.php | 9 +++++++++ src/Module/Diaspora/Receive.php | 6 ++++++ src/Protocol/Diaspora.php | 7 +------ src/Worker/Notifier.php | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 46f41e9a9..9c6742634 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -818,6 +818,15 @@ class Item $item['inform'] = trim($item['inform'] ?? ''); $item['file'] = trim($item['file'] ?? ''); + // Communities aren't working with the Diaspora protoccol + if (($uid != 0) && ($item['network'] == Protocol::DIASPORA)) { + $user = User::getById($uid, ['account-type']); + if ($user['account-type'] == Contact::TYPE_COMMUNITY) { + Logger::info('Community posts are not supported via Diaspora'); + return 0; + } + } + // Items cannot be stored before they happen ... if ($item['created'] > DateTimeFormat::utcNow()) { $item['created'] = DateTimeFormat::utcNow(); diff --git a/src/Module/Diaspora/Receive.php b/src/Module/Diaspora/Receive.php index 498d1b13e..19de0873f 100644 --- a/src/Module/Diaspora/Receive.php +++ b/src/Module/Diaspora/Receive.php @@ -93,6 +93,12 @@ class Receive extends BaseModule $importer = User::getByGuid($this->parameters['guid']); + if ($importer['account-type'] == User::ACCOUNT_TYPE_COMMUNITY) { + // Communities aren't working with the Diaspora protoccol + // We throw an "accepted" here, so that the sender doesn't repeat the delivery + throw new HTTPException\AcceptedException(); + } + $msg = $this->decodePost(false, $importer['prvkey'] ?? ''); $this->logger->info('Diaspora: Dispatching.'); diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index aba79364f..ea0b2b674 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -858,10 +858,6 @@ class Diaspora } elseif (($contact["rel"] == Contact::SHARING) || ($contact["rel"] == Contact::FRIEND)) { // Yes, then it is fine. return true; - // Is it a post to a community? - } elseif (($contact["rel"] == Contact::FOLLOWER) && ($importer['account-type'] == User::ACCOUNT_TYPE_COMMUNITY)) { - // That's good - return true; // Is the message a global user or a comment? } elseif (($importer["uid"] == 0) || $is_comment) { // Messages for the global users and comments are always accepted @@ -3473,9 +3469,8 @@ class Diaspora private static function prependParentAuthorMention($body, $profile_url) { - $profile = Contact::getByURL($profile_url, false, ['addr', 'name', 'contact-type']); + $profile = Contact::getByURL($profile_url, false, ['addr', 'name']); if (!empty($profile['addr']) - && $profile['contact-type'] != Contact::TYPE_COMMUNITY && !strstr($body, $profile['addr']) && !strstr($body, $profile_url) ) { diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index bfd38fe01..3a5c7f13e 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -153,7 +153,7 @@ class Notifier } // Should the post be transmitted to Diaspora? - $diaspora_delivery = true; + $diaspora_delivery = ($owner['account-type'] != User::ACCOUNT_TYPE_COMMUNITY); // If this is a public conversation, notify the feed hub $public_message = true; From 9ae0234bb5cd66a00cbf5887cbddfa0fa1850125 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 15 Feb 2022 09:53:24 -0500 Subject: [PATCH 024/170] Use expected order for post medias - This fixes the wrong display order of post pictures --- src/Model/Post/Media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index 07cad9cf6..254b88115 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -518,7 +518,7 @@ class Media $condition = DBA::mergeConditions($condition, ['type' => $types]); } - return DBA::selectToArray('post-media', [], $condition); + return DBA::selectToArray('post-media', [], $condition, ['order' => ['id']]); } /** From d019ef57d2f994f449bb48915cdbee27a2d95672 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Feb 2022 15:44:44 +0000 Subject: [PATCH 025/170] Database version increased, code simplified --- database.sql | 2 +- src/Model/Item.php | 13 ++++--------- static/dbstructure.config.php | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/database.sql b/database.sql index 308e2e8a8..a36adad01 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2022.05-dev (Siberian Iris) --- DB_UPDATE_VERSION 1451 +-- DB_UPDATE_VERSION 1452 -- ------------------------------------------ diff --git a/src/Model/Item.php b/src/Model/Item.php index 9c6742634..96cf5c488 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2516,11 +2516,6 @@ class Item return true; } - $allow_cid = $allow_cid ?? $item['allow_cid']; - $allow_gid = $allow_gid ?? $item['allow_gid']; - $deny_cid = $deny_cid ?? $item['deny_cid']; - $deny_gid = $deny_gid ?? $item['deny_gid']; - $objtype = $item['resource-id'] ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE; $new_item = [ @@ -2541,10 +2536,10 @@ class Item 'body' => $activity, 'verb' => $activity, 'object-type' => $objtype, - 'allow_cid' => $allow_cid, - 'allow_gid' => $allow_gid, - 'deny_cid' => $deny_cid, - 'deny_gid' => $deny_gid, + 'allow_cid' => $allow_cid ?? $item['allow_cid'], + 'allow_gid' => $allow_gid ?? $item['allow_gid'], + 'deny_cid' => $deny_cid ?? $item['deny_cid'], + 'deny_gid' => $deny_gid ?? $item['deny_gid'], 'visible' => 1, 'unseen' => 1, ]; diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 01419bf2b..f7e02b10b 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -55,7 +55,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1451); + define('DB_UPDATE_VERSION', 1452); } return [ From 99979019bf8782f96caffec002505a02983eacb1 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 15 Feb 2022 15:40:18 -0500 Subject: [PATCH 026/170] Expand system.accept_only_sharer pconfig value to include previous behavior with likes --- mod/settings.php | 13 ++++++++++++- src/Model/Item.php | 7 ++++++- src/Protocol/ActivityPub/Processor.php | 9 +++++++-- src/Protocol/OStatus.php | 9 ++++++--- view/templates/settings/connectors.tpl | 2 +- view/theme/frio/templates/settings/connectors.tpl | 2 +- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/mod/settings.php b/mod/settings.php index 111e52330..6668951e8 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -31,6 +31,7 @@ use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Group; +use Friendica\Model\Item; use Friendica\Model\Notification; use Friendica\Model\Profile; use Friendica\Model\User; @@ -570,7 +571,17 @@ function settings_content(App $a) '$ostat_enabled' => $ostat_enabled, '$general_settings' => DI::l10n()->t('General Social Media Settings'), - '$accept_only_sharer' => ['accept_only_sharer', DI::l10n()->t('Accept only top level posts by contacts you follow'), $accept_only_sharer, DI::l10n()->t('The system does an auto completion of threads when a comment arrives. This has got the side effect that you can receive posts that had been started by a non-follower but had been commented by someone you follow. This setting deactivates this behaviour. When activated, you strictly only will receive posts from people you really do follow.')], + '$accept_only_sharer' => [ + 'accept_only_sharer', + DI::l10n()->t('Followed content scope'), + $accept_only_sharer, + DI::l10n()->t('By default, conversations in which your follows participated but didn\'t start will be shown in your timeline. You can turn this behavior off, or expand it to the conversations in which your follows liked a post.'), + [ + Item::COMPLETION_NONE => DI::l10n()->t('Only conversations my follows started'), + Item::COMPLETION_COMMENT => DI::l10n()->t('Conversations my follows started or commented on (default)'), + Item::COMPLETION_LIKE => DI::l10n()->t('Any conversation my follows interacted with, including likes'), + ] + ], '$enable_cw' => ['enable_cw', DI::l10n()->t('Enable Content Warning'), $enable_cw, DI::l10n()->t('Users on networks like Mastodon or Pleroma are able to set a content warning field which collapse their post by default. This enables the automatic collapsing instead of setting the content warning as the post title. Doesn\'t affect any other content filtering you eventually set up.')], '$enable_smart_shortening' => ['enable_smart_shortening', DI::l10n()->t('Enable intelligent shortening'), $enable_smart_shortening, DI::l10n()->t('Normally the system tries to find the best link to add to shortened posts. If disabled, every shortened post will always point to the original friendica post.')], '$simple_shortening' => ['simple_shortening', DI::l10n()->t('Enable simple text shortening'), $simple_shortening, DI::l10n()->t('Normally the system shortens posts at the next line feed. If this option is enabled then the system will shorten the text at the maximum character limit.')], diff --git a/src/Model/Item.php b/src/Model/Item.php index 96cf5c488..ef3ba01f4 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -74,6 +74,11 @@ class Item const PR_RELAY = 74; const PR_FETCHED = 75; + // system.accept_only_sharer setting values + const COMPLETION_NONE = 1; + const COMPLETION_COMMENT = 0; + const COMPLETION_LIKE = 2; + // Field list that is used to display the items const DISPLAY_FIELDLIST = [ 'uid', 'id', 'parent', 'guid', 'network', 'gravity', @@ -1403,7 +1408,7 @@ class Item $is_reshare = ($item['gravity'] == GRAVITY_ACTIVITY) && ($item['verb'] == Activity::ANNOUNCE); if ((($item['gravity'] == GRAVITY_PARENT) || $is_reshare) && - DI::pConfig()->get($uid, 'system', 'accept_only_sharer') && + DI::pConfig()->get($uid, 'system', 'accept_only_sharer') === self::COMPLETION_NONE && !Contact::isSharingByURL($item['author-link'], $uid) && !Contact::isSharingByURL($item['owner-link'], $uid)) { Logger::info('Contact is not a follower, thread will not be stored', ['author' => $item['author-link'], 'uid' => $uid]); diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index b7ddc09f6..f0d7251a9 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -647,7 +647,12 @@ class Processor Logger::info('Top level post via BCC from a non sharer, ignoring', ['uid' => $receiver, 'contact' => $item['contact-id']]); continue; } - if (!empty($activity['thread-children-type']) && in_array($activity['thread-children-type'], Receiver::ACTIVITY_TYPES)) { + + if ( + !empty($activity['thread-children-type']) + && in_array($activity['thread-children-type'], Receiver::ACTIVITY_TYPES) + && DI::pConfig()->get($receiver, 'system', 'accept_only_sharer', Item::COMPLETION_COMMENT) !== Item::COMPLETION_LIKE + ) { Logger::info('Top level post from thread completion from a non sharer had been initiated via an activity, ignoring', ['type' => $activity['thread-children-type'], 'user' => $item['uid'], 'causer' => $item['causer-link'], 'author' => $activity['author'], 'url' => $item['uri']]); continue; @@ -663,7 +668,7 @@ class Processor } } - if (!$is_forum && DI::pConfig()->get($receiver, 'system', 'accept_only_sharer', false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT)) { + if (!$is_forum && DI::pConfig()->get($receiver, 'system', 'accept_only_sharer', Item::COMPLETION_COMMENT) === Item::COMPLETION_NONE && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT)) { $skip = !Contact::isSharingByURL($activity['author'], $receiver); if ($skip && (($activity['type'] == 'as:Announce') || ($item['isForum'] ?? false))) { diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 86716e993..2b3d7cb12 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -494,19 +494,22 @@ class OStatus if ($initialize && (count(self::$itemlist) > 0)) { if (self::$itemlist[0]['uri'] == self::$itemlist[0]['thr-parent']) { + $uid = self::$itemlist[0]['uid']; // We will import it everytime, when it is started by our contacts - $valid = Contact::isSharingByURL(self::$itemlist[0]['author-link'], self::$itemlist[0]['uid']); + $valid = Contact::isSharingByURL(self::$itemlist[0]['author-link'], $uid); if (!$valid) { // If not, then it depends on this setting - $valid = ((self::$itemlist[0]['uid'] == 0) || !DI::pConfig()->get(self::$itemlist[0]['uid'], 'system', 'accept_only_sharer', false)); + $valid = !$uid || DI::pConfig()->get($uid, 'system', 'accept_only_sharer', Item::COMPLETION_COMMENT) !== Item::COMPLETION_NONE; + if ($valid) { Logger::info("Item with uri ".self::$itemlist[0]['uri']." will be imported due to the system settings."); } } else { Logger::info("Item with uri ".self::$itemlist[0]['uri']." belongs to a contact (".self::$itemlist[0]['contact-id']."). It will be imported."); } - if ($valid) { + + if ($valid && DI::pConfig()->get($uid, 'system', 'accept_only_sharer', Item::COMPLETION_COMMENT) !== Item::COMPLETION_LIKE) { // Never post a thread when the only interaction by our contact was a like $valid = false; $verbs = [Activity::POST, Activity::SHARE]; diff --git a/view/templates/settings/connectors.tpl b/view/templates/settings/connectors.tpl index 0479e99d9..8010cc982 100644 --- a/view/templates/settings/connectors.tpl +++ b/view/templates/settings/connectors.tpl @@ -11,7 +11,7 @@
- {{include file="field_checkbox.tpl" field=$accept_only_sharer}} + {{include file="field_select.tpl" field=$accept_only_sharer}} {{include file="field_checkbox.tpl" field=$enable_cw}} From 785ea0325ec8cec2520794a96c800e29e7793d6e Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 15 Feb 2022 15:54:12 -0500 Subject: [PATCH 027/170] Updated main translation file after changing several strings --- view/lang/C/messages.po | 490 ++++++++++++++++++++-------------------- 1 file changed, 250 insertions(+), 240 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index af98956ec..2c94f270c 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.05-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-10 09:02+0100\n" +"POT-Creation-Date: 2022-02-15 15:52-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -36,7 +36,7 @@ msgstr "" msgid "User not found." msgstr "" -#: mod/cal.php:120 mod/display.php:270 src/Module/Profile/Profile.php:94 +#: mod/cal.php:120 mod/display.php:238 src/Module/Profile/Profile.php:94 #: src/Module/Profile/Profile.php:109 src/Module/Profile/Status.php:109 #: src/Module/Update/Profile.php:56 msgid "Access to this profile has been restricted." @@ -103,25 +103,25 @@ msgstr "" msgid "calendar" msgstr "" -#: mod/display.php:165 mod/photos.php:808 +#: mod/display.php:133 mod/photos.php:808 #: src/Module/Conversation/Community.php:175 src/Module/Directory.php:48 #: src/Module/Search/Index.php:49 msgid "Public access denied." msgstr "" -#: mod/display.php:221 mod/display.php:295 +#: mod/display.php:189 mod/display.php:263 msgid "The requested item doesn't exist or has been deleted." msgstr "" -#: mod/display.php:375 +#: mod/display.php:343 msgid "The feed for this item is unavailable." msgstr "" #: mod/editpost.php:38 mod/events.php:220 mod/follow.php:56 mod/follow.php:130 -#: mod/item.php:185 mod/item.php:190 mod/item.php:930 mod/message.php:69 +#: mod/item.php:184 mod/item.php:189 mod/item.php:918 mod/message.php:69 #: mod/message.php:111 mod/notes.php:44 mod/ostatus_subscribe.php:32 #: mod/photos.php:160 mod/photos.php:897 mod/repair_ostatus.php:31 -#: mod/settings.php:46 mod/settings.php:56 mod/settings.php:412 +#: mod/settings.php:47 mod/settings.php:57 mod/settings.php:413 #: mod/suggest.php:34 mod/uimport.php:33 mod/unfollow.php:35 #: mod/unfollow.php:50 mod/unfollow.php:82 mod/wall_attach.php:68 #: mod/wall_attach.php:71 mod/wall_upload.php:90 mod/wall_upload.php:93 @@ -465,7 +465,7 @@ msgid "OStatus support is disabled. Contact can't be added." msgstr "" #: mod/follow.php:138 src/Content/Item.php:452 src/Content/Widget.php:76 -#: src/Model/Contact.php:1056 src/Model/Contact.php:1068 +#: src/Model/Contact.php:1057 src/Model/Contact.php:1069 #: view/theme/vier/theme.php:172 msgid "Connect/Follow" msgstr "" @@ -510,27 +510,27 @@ msgstr "" msgid "The contact could not be added." msgstr "" -#: mod/item.php:135 mod/item.php:139 +#: mod/item.php:134 mod/item.php:138 msgid "Unable to locate original post." msgstr "" -#: mod/item.php:341 mod/item.php:346 +#: mod/item.php:340 mod/item.php:345 msgid "Empty post discarded." msgstr "" -#: mod/item.php:736 +#: mod/item.php:724 msgid "Post updated." msgstr "" -#: mod/item.php:746 mod/item.php:751 +#: mod/item.php:734 mod/item.php:739 msgid "Item wasn't stored." msgstr "" -#: mod/item.php:762 +#: mod/item.php:750 msgid "Item couldn't be fetched." msgstr "" -#: mod/item.php:908 src/Module/Admin/Themes/Details.php:39 +#: mod/item.php:896 src/Module/Admin/Themes/Details.php:39 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:41 #: src/Module/Debug/ItemBody.php:56 msgid "Item not found." @@ -1079,7 +1079,7 @@ msgstr "" msgid "Select" msgstr "" -#: mod/photos.php:1431 mod/settings.php:596 src/Content/Conversation.php:616 +#: mod/photos.php:1431 mod/settings.php:607 src/Content/Conversation.php:616 #: src/Module/Admin/Users/Active.php:139 src/Module/Admin/Users/Blocked.php:140 #: src/Module/Admin/Users/Index.php:153 msgid "Delete" @@ -1183,75 +1183,75 @@ msgid_plural "Errors" msgstr[0] "" msgstr[1] "" -#: mod/settings.php:128 +#: mod/settings.php:129 msgid "Failed to connect with email account using the settings provided." msgstr "" -#: mod/settings.php:158 +#: mod/settings.php:159 msgid "Contact CSV file upload error" msgstr "" -#: mod/settings.php:177 +#: mod/settings.php:178 msgid "Importing Contacts done" msgstr "" -#: mod/settings.php:190 +#: mod/settings.php:191 msgid "Relocate message has been send to your contacts" msgstr "" -#: mod/settings.php:202 +#: mod/settings.php:203 msgid "Passwords do not match." msgstr "" -#: mod/settings.php:210 src/Console/User.php:210 +#: mod/settings.php:211 src/Console/User.php:210 msgid "Password update failed. Please try again." msgstr "" -#: mod/settings.php:213 src/Console/User.php:213 +#: mod/settings.php:214 src/Console/User.php:213 msgid "Password changed." msgstr "" -#: mod/settings.php:216 +#: mod/settings.php:217 msgid "Password unchanged." msgstr "" -#: mod/settings.php:304 +#: mod/settings.php:305 msgid "Please use a shorter name." msgstr "" -#: mod/settings.php:307 +#: mod/settings.php:308 msgid "Name too short." msgstr "" -#: mod/settings.php:316 +#: mod/settings.php:317 msgid "Wrong Password." msgstr "" -#: mod/settings.php:321 +#: mod/settings.php:322 msgid "Invalid email." msgstr "" -#: mod/settings.php:327 +#: mod/settings.php:328 msgid "Cannot change to that email." msgstr "" -#: mod/settings.php:368 +#: mod/settings.php:369 msgid "Private forum has no privacy permissions. Using default privacy group." msgstr "" -#: mod/settings.php:371 +#: mod/settings.php:372 msgid "Private forum has no privacy permissions and no default privacy group." msgstr "" -#: mod/settings.php:390 +#: mod/settings.php:391 msgid "Settings were not updated." msgstr "" -#: mod/settings.php:431 +#: mod/settings.php:432 msgid "Connected Apps" msgstr "" -#: mod/settings.php:432 src/Module/Admin/Blocklist/Contact.php:106 +#: mod/settings.php:433 src/Module/Admin/Blocklist/Contact.php:106 #: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:130 #: src/Module/Admin/Users/Create.php:71 src/Module/Admin/Users/Deleted.php:88 #: src/Module/Admin/Users/Index.php:142 src/Module/Admin/Users/Index.php:162 @@ -1259,20 +1259,20 @@ msgstr "" msgid "Name" msgstr "" -#: mod/settings.php:433 src/Content/Nav.php:212 +#: mod/settings.php:434 src/Content/Nav.php:212 msgid "Home Page" msgstr "" -#: mod/settings.php:434 src/Module/Admin/Queue.php:78 +#: mod/settings.php:435 src/Module/Admin/Queue.php:78 msgid "Created" msgstr "" -#: mod/settings.php:435 +#: mod/settings.php:436 msgid "Remove authorization" msgstr "" -#: mod/settings.php:461 mod/settings.php:493 mod/settings.php:524 -#: mod/settings.php:598 mod/settings.php:735 +#: mod/settings.php:462 mod/settings.php:494 mod/settings.php:525 +#: mod/settings.php:609 mod/settings.php:746 #: src/Module/Admin/Addons/Index.php:69 src/Module/Admin/Features.php:87 #: src/Module/Admin/Logs/Settings.php:81 src/Module/Admin/Site.php:501 #: src/Module/Admin/Themes/Index.php:113 src/Module/Admin/Tos.php:83 @@ -1280,73 +1280,83 @@ msgstr "" msgid "Save Settings" msgstr "" -#: mod/settings.php:469 +#: mod/settings.php:470 msgid "Addon Settings" msgstr "" -#: mod/settings.php:470 +#: mod/settings.php:471 msgid "No Addon settings configured" msgstr "" -#: mod/settings.php:491 +#: mod/settings.php:492 msgid "Additional Features" msgstr "" -#: mod/settings.php:529 +#: mod/settings.php:530 msgid "Diaspora (Socialhome, Hubzilla)" msgstr "" -#: mod/settings.php:529 mod/settings.php:530 +#: mod/settings.php:530 mod/settings.php:531 msgid "enabled" msgstr "" -#: mod/settings.php:529 mod/settings.php:530 +#: mod/settings.php:530 mod/settings.php:531 msgid "disabled" msgstr "" -#: mod/settings.php:529 mod/settings.php:530 +#: mod/settings.php:530 mod/settings.php:531 #, php-format msgid "Built-in support for %s connectivity is %s" msgstr "" -#: mod/settings.php:530 +#: mod/settings.php:531 msgid "OStatus (GNU Social)" msgstr "" -#: mod/settings.php:556 +#: mod/settings.php:557 msgid "Email access is disabled on this site." msgstr "" -#: mod/settings.php:561 mod/settings.php:596 +#: mod/settings.php:562 mod/settings.php:607 msgid "None" msgstr "" -#: mod/settings.php:567 src/Module/BaseSettings.php:78 +#: mod/settings.php:568 src/Module/BaseSettings.php:78 msgid "Social Networks" msgstr "" -#: mod/settings.php:572 +#: mod/settings.php:573 msgid "General Social Media Settings" msgstr "" -#: mod/settings.php:573 -msgid "Accept only top level posts by contacts you follow" +#: mod/settings.php:576 +msgid "Followed content scope" msgstr "" -#: mod/settings.php:573 +#: mod/settings.php:578 msgid "" -"The system does an auto completion of threads when a comment arrives. This " -"has got the side effect that you can receive posts that had been started by " -"a non-follower but had been commented by someone you follow. This setting " -"deactivates this behaviour. When activated, you strictly only will receive " -"posts from people you really do follow." +"By default, conversations in which your follows participated but didn't " +"start will be shown in your timeline. You can turn this behavior off, or " +"expand it to the conversations in which your follows liked a post." msgstr "" -#: mod/settings.php:574 +#: mod/settings.php:580 +msgid "Only conversations my follows started" +msgstr "" + +#: mod/settings.php:581 +msgid "Conversations my follows started or commented on (default)" +msgstr "" + +#: mod/settings.php:582 +msgid "Any conversation my follows interacted with, including likes" +msgstr "" + +#: mod/settings.php:585 msgid "Enable Content Warning" msgstr "" -#: mod/settings.php:574 +#: mod/settings.php:585 msgid "" "Users on networks like Mastodon or Pleroma are able to set a content warning " "field which collapse their post by default. This enables the automatic " @@ -1354,222 +1364,222 @@ msgid "" "affect any other content filtering you eventually set up." msgstr "" -#: mod/settings.php:575 +#: mod/settings.php:586 msgid "Enable intelligent shortening" msgstr "" -#: mod/settings.php:575 +#: mod/settings.php:586 msgid "" "Normally the system tries to find the best link to add to shortened posts. " "If disabled, every shortened post will always point to the original " "friendica post." msgstr "" -#: mod/settings.php:576 +#: mod/settings.php:587 msgid "Enable simple text shortening" msgstr "" -#: mod/settings.php:576 +#: mod/settings.php:587 msgid "" "Normally the system shortens posts at the next line feed. If this option is " "enabled then the system will shorten the text at the maximum character limit." msgstr "" -#: mod/settings.php:577 +#: mod/settings.php:588 msgid "Attach the link title" msgstr "" -#: mod/settings.php:577 +#: mod/settings.php:588 msgid "" "When activated, the title of the attached link will be added as a title on " "posts to Diaspora. This is mostly helpful with \"remote-self\" contacts that " "share feed content." msgstr "" -#: mod/settings.php:578 +#: mod/settings.php:589 msgid "Your legacy ActivityPub/GNU Social account" msgstr "" -#: mod/settings.php:578 +#: mod/settings.php:589 msgid "" "If you enter your old account name from an ActivityPub based system or your " "GNU Social/Statusnet account name here (in the format user@domain.tld), your " "contacts will be added automatically. The field will be emptied when done." msgstr "" -#: mod/settings.php:581 +#: mod/settings.php:592 msgid "Repair OStatus subscriptions" msgstr "" -#: mod/settings.php:585 +#: mod/settings.php:596 msgid "Email/Mailbox Setup" msgstr "" -#: mod/settings.php:586 +#: mod/settings.php:597 msgid "" "If you wish to communicate with email contacts using this service " "(optional), please specify how to connect to your mailbox." msgstr "" -#: mod/settings.php:587 +#: mod/settings.php:598 msgid "Last successful email check:" msgstr "" -#: mod/settings.php:589 +#: mod/settings.php:600 msgid "IMAP server name:" msgstr "" -#: mod/settings.php:590 +#: mod/settings.php:601 msgid "IMAP port:" msgstr "" -#: mod/settings.php:591 +#: mod/settings.php:602 msgid "Security:" msgstr "" -#: mod/settings.php:592 +#: mod/settings.php:603 msgid "Email login name:" msgstr "" -#: mod/settings.php:593 +#: mod/settings.php:604 msgid "Email password:" msgstr "" -#: mod/settings.php:594 +#: mod/settings.php:605 msgid "Reply-to address:" msgstr "" -#: mod/settings.php:595 +#: mod/settings.php:606 msgid "Send public posts to all email contacts:" msgstr "" -#: mod/settings.php:596 +#: mod/settings.php:607 msgid "Action after import:" msgstr "" -#: mod/settings.php:596 src/Content/Nav.php:280 +#: mod/settings.php:607 src/Content/Nav.php:280 msgid "Mark as seen" msgstr "" -#: mod/settings.php:596 +#: mod/settings.php:607 msgid "Move to folder" msgstr "" -#: mod/settings.php:597 +#: mod/settings.php:608 msgid "Move to folder:" msgstr "" -#: mod/settings.php:611 +#: mod/settings.php:622 msgid "Unable to find your profile. Please contact your admin." msgstr "" -#: mod/settings.php:649 src/Content/Widget.php:526 +#: mod/settings.php:660 src/Content/Widget.php:526 msgid "Account Types" msgstr "" -#: mod/settings.php:650 +#: mod/settings.php:661 msgid "Personal Page Subtypes" msgstr "" -#: mod/settings.php:651 +#: mod/settings.php:662 msgid "Community Forum Subtypes" msgstr "" -#: mod/settings.php:658 src/Module/Admin/BaseUsers.php:107 +#: mod/settings.php:669 src/Module/Admin/BaseUsers.php:107 msgid "Personal Page" msgstr "" -#: mod/settings.php:659 +#: mod/settings.php:670 msgid "Account for a personal profile." msgstr "" -#: mod/settings.php:662 src/Module/Admin/BaseUsers.php:108 +#: mod/settings.php:673 src/Module/Admin/BaseUsers.php:108 msgid "Organisation Page" msgstr "" -#: mod/settings.php:663 +#: mod/settings.php:674 msgid "" "Account for an organisation that automatically approves contact requests as " "\"Followers\"." msgstr "" -#: mod/settings.php:666 src/Module/Admin/BaseUsers.php:109 +#: mod/settings.php:677 src/Module/Admin/BaseUsers.php:109 msgid "News Page" msgstr "" -#: mod/settings.php:667 +#: mod/settings.php:678 msgid "" "Account for a news reflector that automatically approves contact requests as " "\"Followers\"." msgstr "" -#: mod/settings.php:670 src/Module/Admin/BaseUsers.php:110 +#: mod/settings.php:681 src/Module/Admin/BaseUsers.php:110 msgid "Community Forum" msgstr "" -#: mod/settings.php:671 +#: mod/settings.php:682 msgid "Account for community discussions." msgstr "" -#: mod/settings.php:674 src/Module/Admin/BaseUsers.php:100 +#: mod/settings.php:685 src/Module/Admin/BaseUsers.php:100 msgid "Normal Account Page" msgstr "" -#: mod/settings.php:675 +#: mod/settings.php:686 msgid "" "Account for a regular personal profile that requires manual approval of " "\"Friends\" and \"Followers\"." msgstr "" -#: mod/settings.php:678 src/Module/Admin/BaseUsers.php:101 +#: mod/settings.php:689 src/Module/Admin/BaseUsers.php:101 msgid "Soapbox Page" msgstr "" -#: mod/settings.php:679 +#: mod/settings.php:690 msgid "" "Account for a public profile that automatically approves contact requests as " "\"Followers\"." msgstr "" -#: mod/settings.php:682 src/Module/Admin/BaseUsers.php:102 +#: mod/settings.php:693 src/Module/Admin/BaseUsers.php:102 msgid "Public Forum" msgstr "" -#: mod/settings.php:683 +#: mod/settings.php:694 msgid "Automatically approves all contact requests." msgstr "" -#: mod/settings.php:686 src/Module/Admin/BaseUsers.php:103 +#: mod/settings.php:697 src/Module/Admin/BaseUsers.php:103 msgid "Automatic Friend Page" msgstr "" -#: mod/settings.php:687 +#: mod/settings.php:698 msgid "" "Account for a popular profile that automatically approves contact requests " "as \"Friends\"." msgstr "" -#: mod/settings.php:690 +#: mod/settings.php:701 msgid "Private Forum [Experimental]" msgstr "" -#: mod/settings.php:691 +#: mod/settings.php:702 msgid "Requires manual approval of contact requests." msgstr "" -#: mod/settings.php:702 +#: mod/settings.php:713 msgid "OpenID:" msgstr "" -#: mod/settings.php:702 +#: mod/settings.php:713 msgid "(Optional) Allow this OpenID to login to this account." msgstr "" -#: mod/settings.php:710 +#: mod/settings.php:721 msgid "Publish your profile in your local site directory?" msgstr "" -#: mod/settings.php:710 +#: mod/settings.php:721 #, php-format msgid "" "Your profile will be published in this node's local " @@ -1577,115 +1587,115 @@ msgid "" "system settings." msgstr "" -#: mod/settings.php:716 +#: mod/settings.php:727 #, php-format msgid "" "Your profile will also be published in the global friendica directories (e." "g. %s)." msgstr "" -#: mod/settings.php:722 +#: mod/settings.php:733 #, php-format msgid "Your Identity Address is '%s' or '%s'." msgstr "" -#: mod/settings.php:733 +#: mod/settings.php:744 msgid "Account Settings" msgstr "" -#: mod/settings.php:741 +#: mod/settings.php:752 msgid "Password Settings" msgstr "" -#: mod/settings.php:742 src/Module/Register.php:162 +#: mod/settings.php:753 src/Module/Register.php:162 msgid "New Password:" msgstr "" -#: mod/settings.php:742 +#: mod/settings.php:753 msgid "" "Allowed characters are a-z, A-Z, 0-9 and special characters except white " "spaces, accentuated letters and colon (:)." msgstr "" -#: mod/settings.php:743 src/Module/Register.php:163 +#: mod/settings.php:754 src/Module/Register.php:163 msgid "Confirm:" msgstr "" -#: mod/settings.php:743 +#: mod/settings.php:754 msgid "Leave password fields blank unless changing" msgstr "" -#: mod/settings.php:744 +#: mod/settings.php:755 msgid "Current Password:" msgstr "" -#: mod/settings.php:744 +#: mod/settings.php:755 msgid "Your current password to confirm the changes" msgstr "" -#: mod/settings.php:745 +#: mod/settings.php:756 msgid "Password:" msgstr "" -#: mod/settings.php:745 +#: mod/settings.php:756 msgid "Your current password to confirm the changes of the email address" msgstr "" -#: mod/settings.php:748 +#: mod/settings.php:759 msgid "Delete OpenID URL" msgstr "" -#: mod/settings.php:750 +#: mod/settings.php:761 msgid "Basic Settings" msgstr "" -#: mod/settings.php:751 src/Module/Profile/Profile.php:144 +#: mod/settings.php:762 src/Module/Profile/Profile.php:144 msgid "Full Name:" msgstr "" -#: mod/settings.php:752 +#: mod/settings.php:763 msgid "Email Address:" msgstr "" -#: mod/settings.php:753 +#: mod/settings.php:764 msgid "Your Timezone:" msgstr "" -#: mod/settings.php:754 +#: mod/settings.php:765 msgid "Your Language:" msgstr "" -#: mod/settings.php:754 +#: mod/settings.php:765 msgid "" "Set the language we use to show you friendica interface and to send you " "emails" msgstr "" -#: mod/settings.php:755 +#: mod/settings.php:766 msgid "Default Post Location:" msgstr "" -#: mod/settings.php:756 +#: mod/settings.php:767 msgid "Use Browser Location:" msgstr "" -#: mod/settings.php:758 +#: mod/settings.php:769 msgid "Security and Privacy Settings" msgstr "" -#: mod/settings.php:760 +#: mod/settings.php:771 msgid "Maximum Friend Requests/Day:" msgstr "" -#: mod/settings.php:760 mod/settings.php:770 +#: mod/settings.php:771 mod/settings.php:781 msgid "(to prevent spam abuse)" msgstr "" -#: mod/settings.php:762 +#: mod/settings.php:773 msgid "Allow your profile to be searchable globally?" msgstr "" -#: mod/settings.php:762 +#: mod/settings.php:773 msgid "" "Activate this setting if you want others to easily find and follow you. Your " "profile will be searchable on remote systems. This setting also determines " @@ -1693,43 +1703,43 @@ msgid "" "indexed or not." msgstr "" -#: mod/settings.php:763 +#: mod/settings.php:774 msgid "Hide your contact/friend list from viewers of your profile?" msgstr "" -#: mod/settings.php:763 +#: mod/settings.php:774 msgid "" "A list of your contacts is displayed on your profile page. Activate this " "option to disable the display of your contact list." msgstr "" -#: mod/settings.php:764 +#: mod/settings.php:775 msgid "Hide your profile details from anonymous viewers?" msgstr "" -#: mod/settings.php:764 +#: mod/settings.php:775 msgid "" "Anonymous visitors will only see your profile picture, your display name and " "the nickname you are using on your profile page. Your public posts and " "replies will still be accessible by other means." msgstr "" -#: mod/settings.php:765 +#: mod/settings.php:776 msgid "Make public posts unlisted" msgstr "" -#: mod/settings.php:765 +#: mod/settings.php:776 msgid "" "Your public posts will not appear on the community pages or in search " "results, nor be sent to relay servers. However they can still appear on " "public feeds on remote servers." msgstr "" -#: mod/settings.php:766 +#: mod/settings.php:777 msgid "Make all posted pictures accessible" msgstr "" -#: mod/settings.php:766 +#: mod/settings.php:777 msgid "" "This option makes every posted picture accessible via the direct link. This " "is a workaround for the problem that most other networks can't handle " @@ -1737,221 +1747,221 @@ msgid "" "public on your photo albums though." msgstr "" -#: mod/settings.php:767 +#: mod/settings.php:778 msgid "Allow friends to post to your profile page?" msgstr "" -#: mod/settings.php:767 +#: mod/settings.php:778 msgid "" "Your contacts may write posts on your profile wall. These posts will be " "distributed to your contacts" msgstr "" -#: mod/settings.php:768 +#: mod/settings.php:779 msgid "Allow friends to tag your posts?" msgstr "" -#: mod/settings.php:768 +#: mod/settings.php:779 msgid "Your contacts can add additional tags to your posts." msgstr "" -#: mod/settings.php:769 +#: mod/settings.php:780 msgid "Permit unknown people to send you private mail?" msgstr "" -#: mod/settings.php:769 +#: mod/settings.php:780 msgid "" "Friendica network users may send you private messages even if they are not " "in your contact list." msgstr "" -#: mod/settings.php:770 +#: mod/settings.php:781 msgid "Maximum private messages per day from unknown people:" msgstr "" -#: mod/settings.php:772 +#: mod/settings.php:783 msgid "Default Post Permissions" msgstr "" -#: mod/settings.php:776 +#: mod/settings.php:787 msgid "Expiration settings" msgstr "" -#: mod/settings.php:777 +#: mod/settings.php:788 msgid "Automatically expire posts after this many days:" msgstr "" -#: mod/settings.php:777 +#: mod/settings.php:788 msgid "If empty, posts will not expire. Expired posts will be deleted" msgstr "" -#: mod/settings.php:778 +#: mod/settings.php:789 msgid "Expire posts" msgstr "" -#: mod/settings.php:778 +#: mod/settings.php:789 msgid "When activated, posts and comments will be expired." msgstr "" -#: mod/settings.php:779 +#: mod/settings.php:790 msgid "Expire personal notes" msgstr "" -#: mod/settings.php:779 +#: mod/settings.php:790 msgid "" "When activated, the personal notes on your profile page will be expired." msgstr "" -#: mod/settings.php:780 +#: mod/settings.php:791 msgid "Expire starred posts" msgstr "" -#: mod/settings.php:780 +#: mod/settings.php:791 msgid "" "Starring posts keeps them from being expired. That behaviour is overwritten " "by this setting." msgstr "" -#: mod/settings.php:781 +#: mod/settings.php:792 msgid "Expire photos" msgstr "" -#: mod/settings.php:781 +#: mod/settings.php:792 msgid "When activated, photos will be expired." msgstr "" -#: mod/settings.php:782 +#: mod/settings.php:793 msgid "Only expire posts by others" msgstr "" -#: mod/settings.php:782 +#: mod/settings.php:793 msgid "" "When activated, your own posts never expire. Then the settings above are " "only valid for posts you received." msgstr "" -#: mod/settings.php:785 +#: mod/settings.php:796 msgid "Notification Settings" msgstr "" -#: mod/settings.php:786 +#: mod/settings.php:797 msgid "Send a notification email when:" msgstr "" -#: mod/settings.php:787 +#: mod/settings.php:798 msgid "You receive an introduction" msgstr "" -#: mod/settings.php:788 +#: mod/settings.php:799 msgid "Your introductions are confirmed" msgstr "" -#: mod/settings.php:789 +#: mod/settings.php:800 msgid "Someone writes on your profile wall" msgstr "" -#: mod/settings.php:790 +#: mod/settings.php:801 msgid "Someone writes a followup comment" msgstr "" -#: mod/settings.php:791 +#: mod/settings.php:802 msgid "You receive a private message" msgstr "" -#: mod/settings.php:792 +#: mod/settings.php:803 msgid "You receive a friend suggestion" msgstr "" -#: mod/settings.php:793 +#: mod/settings.php:804 msgid "You are tagged in a post" msgstr "" -#: mod/settings.php:794 +#: mod/settings.php:805 msgid "You are poked/prodded/etc. in a post" msgstr "" -#: mod/settings.php:796 +#: mod/settings.php:807 msgid "Create a desktop notification when:" msgstr "" -#: mod/settings.php:797 +#: mod/settings.php:808 msgid "Someone liked your content" msgstr "" -#: mod/settings.php:798 +#: mod/settings.php:809 msgid "Someone shared your content" msgstr "" -#: mod/settings.php:800 +#: mod/settings.php:811 msgid "Activate desktop notifications" msgstr "" -#: mod/settings.php:800 +#: mod/settings.php:811 msgid "Show desktop popup on new notifications" msgstr "" -#: mod/settings.php:802 +#: mod/settings.php:813 msgid "Text-only notification emails" msgstr "" -#: mod/settings.php:804 +#: mod/settings.php:815 msgid "Send text only notification emails, without the html part" msgstr "" -#: mod/settings.php:806 +#: mod/settings.php:817 msgid "Show detailled notifications" msgstr "" -#: mod/settings.php:808 +#: mod/settings.php:819 msgid "" "Per default, notifications are condensed to a single notification per item. " "When enabled every notification is displayed." msgstr "" -#: mod/settings.php:810 +#: mod/settings.php:821 msgid "Show notifications of ignored contacts" msgstr "" -#: mod/settings.php:812 +#: mod/settings.php:823 msgid "" "You don't see posts from ignored contacts. But you still see their comments. " "This setting controls if you want to still receive regular notifications " "that are caused by ignored contacts or not." msgstr "" -#: mod/settings.php:814 +#: mod/settings.php:825 msgid "Advanced Account/Page Type Settings" msgstr "" -#: mod/settings.php:815 +#: mod/settings.php:826 msgid "Change the behaviour of this account for special situations" msgstr "" -#: mod/settings.php:818 +#: mod/settings.php:829 msgid "Import Contacts" msgstr "" -#: mod/settings.php:819 +#: mod/settings.php:830 msgid "" "Upload a CSV file that contains the handle of your followed accounts in the " "first column you exported from the old account." msgstr "" -#: mod/settings.php:820 +#: mod/settings.php:831 msgid "Upload File" msgstr "" -#: mod/settings.php:822 +#: mod/settings.php:833 msgid "Relocate" msgstr "" -#: mod/settings.php:823 +#: mod/settings.php:834 msgid "" "If you have moved this profile from another server, and some of your " "contacts don't receive your updates, try pushing this button." msgstr "" -#: mod/settings.php:824 +#: mod/settings.php:835 msgid "Resend relocate message to contacts" msgstr "" @@ -1965,7 +1975,7 @@ msgstr "" msgid "Friend Suggestions" msgstr "" -#: mod/tagger.php:78 src/Content/Item.php:335 src/Model/Item.php:2620 +#: mod/tagger.php:78 src/Content/Item.php:335 src/Model/Item.php:2662 msgid "photo" msgstr "" @@ -2719,7 +2729,7 @@ msgstr "" msgid "%1$s poked %2$s" msgstr "" -#: src/Content/Item.php:327 src/Model/Item.php:2618 +#: src/Content/Item.php:327 src/Model/Item.php:2660 msgid "event" msgstr "" @@ -2727,31 +2737,31 @@ msgstr "" msgid "Follow Thread" msgstr "" -#: src/Content/Item.php:432 src/Model/Contact.php:1061 +#: src/Content/Item.php:432 src/Model/Contact.php:1062 msgid "View Status" msgstr "" -#: src/Content/Item.php:433 src/Content/Item.php:455 src/Model/Contact.php:995 -#: src/Model/Contact.php:1053 src/Model/Contact.php:1062 +#: src/Content/Item.php:433 src/Content/Item.php:455 src/Model/Contact.php:996 +#: src/Model/Contact.php:1054 src/Model/Contact.php:1063 #: src/Module/Directory.php:157 src/Module/Settings/Profile/Index.php:225 msgid "View Profile" msgstr "" -#: src/Content/Item.php:434 src/Model/Contact.php:1063 +#: src/Content/Item.php:434 src/Model/Contact.php:1064 msgid "View Photos" msgstr "" -#: src/Content/Item.php:435 src/Model/Contact.php:1054 -#: src/Model/Contact.php:1064 +#: src/Content/Item.php:435 src/Model/Contact.php:1055 +#: src/Model/Contact.php:1065 msgid "Network Posts" msgstr "" -#: src/Content/Item.php:436 src/Model/Contact.php:1055 -#: src/Model/Contact.php:1065 +#: src/Content/Item.php:436 src/Model/Contact.php:1056 +#: src/Model/Contact.php:1066 msgid "View Contact" msgstr "" -#: src/Content/Item.php:437 src/Model/Contact.php:1066 +#: src/Content/Item.php:437 src/Model/Contact.php:1067 msgid "Send PM" msgstr "" @@ -2774,7 +2784,7 @@ msgstr "" msgid "Languages" msgstr "" -#: src/Content/Item.php:447 src/Model/Contact.php:1067 +#: src/Content/Item.php:447 src/Model/Contact.php:1068 msgid "Poke" msgstr "" @@ -3070,8 +3080,8 @@ msgid "" "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:1185 src/Model/Item.php:3149 -#: src/Model/Item.php:3155 src/Model/Item.php:3156 +#: src/Content/Text/BBCode.php:1185 src/Model/Item.php:3191 +#: src/Model/Item.php:3197 src/Model/Item.php:3198 msgid "Link to source" msgstr "" @@ -3226,7 +3236,7 @@ msgstr "" msgid "Organisations" msgstr "" -#: src/Content/Widget.php:522 src/Model/Contact.php:1471 +#: src/Content/Widget.php:522 src/Model/Contact.php:1472 msgid "News" msgstr "" @@ -4049,81 +4059,81 @@ msgstr "" msgid "Legacy module file not found: %s" msgstr "" -#: src/Model/Contact.php:1057 src/Model/Contact.php:1069 +#: src/Model/Contact.php:1058 src/Model/Contact.php:1070 msgid "UnFollow" msgstr "" -#: src/Model/Contact.php:1075 src/Module/Admin/Users/Pending.php:107 +#: src/Model/Contact.php:1076 src/Module/Admin/Users/Pending.php:107 #: src/Module/Notifications/Introductions.php:130 #: src/Module/Notifications/Introductions.php:202 msgid "Approve" msgstr "" -#: src/Model/Contact.php:1467 +#: src/Model/Contact.php:1468 msgid "Organisation" msgstr "" -#: src/Model/Contact.php:1475 +#: src/Model/Contact.php:1476 msgid "Forum" msgstr "" -#: src/Model/Contact.php:2410 +#: src/Model/Contact.php:2411 msgid "Disallowed profile URL." msgstr "" -#: src/Model/Contact.php:2415 src/Module/Friendica.php:81 +#: src/Model/Contact.php:2416 src/Module/Friendica.php:81 msgid "Blocked domain" msgstr "" -#: src/Model/Contact.php:2420 +#: src/Model/Contact.php:2421 msgid "Connect URL missing." msgstr "" -#: src/Model/Contact.php:2429 +#: src/Model/Contact.php:2430 msgid "" "The contact could not be added. Please check the relevant network " "credentials in your Settings -> Social Networks page." msgstr "" -#: src/Model/Contact.php:2466 +#: src/Model/Contact.php:2467 msgid "The profile address specified does not provide adequate information." msgstr "" -#: src/Model/Contact.php:2468 +#: src/Model/Contact.php:2469 msgid "No compatible communication protocols or feeds were discovered." msgstr "" -#: src/Model/Contact.php:2471 +#: src/Model/Contact.php:2472 msgid "An author or name was not found." msgstr "" -#: src/Model/Contact.php:2474 +#: src/Model/Contact.php:2475 msgid "No browser URL could be matched to this address." msgstr "" -#: src/Model/Contact.php:2477 +#: src/Model/Contact.php:2478 msgid "" "Unable to match @-style Identity Address with a known protocol or email " "contact." msgstr "" -#: src/Model/Contact.php:2478 +#: src/Model/Contact.php:2479 msgid "Use mailto: in front of address to force email check." msgstr "" -#: src/Model/Contact.php:2484 +#: src/Model/Contact.php:2485 msgid "" "The profile address specified belongs to a network which has been disabled " "on this site." msgstr "" -#: src/Model/Contact.php:2489 +#: src/Model/Contact.php:2490 msgid "" "Limited profile. This person will be unable to receive direct/personal " "notifications from you." msgstr "" -#: src/Model/Contact.php:2548 +#: src/Model/Contact.php:2549 msgid "Unable to retrieve contact information." msgstr "" @@ -4243,33 +4253,33 @@ msgstr "" msgid "Edit groups" msgstr "" -#: src/Model/Item.php:1691 +#: src/Model/Item.php:1751 #, php-format msgid "Detected languages in this post:\\n%s" msgstr "" -#: src/Model/Item.php:2622 +#: src/Model/Item.php:2664 msgid "activity" msgstr "" -#: src/Model/Item.php:2624 +#: src/Model/Item.php:2666 msgid "comment" msgstr "" -#: src/Model/Item.php:2627 +#: src/Model/Item.php:2669 msgid "post" msgstr "" -#: src/Model/Item.php:2764 +#: src/Model/Item.php:2806 #, php-format msgid "Content warning: %s" msgstr "" -#: src/Model/Item.php:3114 +#: src/Model/Item.php:3156 msgid "bytes" msgstr "" -#: src/Model/Item.php:3143 src/Model/Item.php:3144 +#: src/Model/Item.php:3185 src/Model/Item.php:3186 msgid "View on separate page" msgstr "" @@ -8651,19 +8661,19 @@ msgstr "" #: src/Module/Profile/Profile.php:326 src/Module/Profile/Profile.php:329 #: src/Module/Profile/Status.php:65 src/Module/Profile/Status.php:68 -#: src/Protocol/Feed.php:990 src/Protocol/OStatus.php:1242 +#: src/Protocol/Feed.php:990 src/Protocol/OStatus.php:1245 #, php-format msgid "%s's timeline" msgstr "" #: src/Module/Profile/Profile.php:327 src/Module/Profile/Status.php:66 -#: src/Protocol/Feed.php:994 src/Protocol/OStatus.php:1246 +#: src/Protocol/Feed.php:994 src/Protocol/OStatus.php:1249 #, php-format msgid "%s's posts" msgstr "" #: src/Module/Profile/Profile.php:328 src/Module/Profile/Status.php:67 -#: src/Protocol/Feed.php:997 src/Protocol/OStatus.php:1249 +#: src/Protocol/Feed.php:997 src/Protocol/OStatus.php:1252 #, php-format msgid "%s's comments" msgstr "" @@ -10593,21 +10603,21 @@ msgstr "" msgid "Show fewer" msgstr "" -#: src/Protocol/OStatus.php:1645 +#: src/Protocol/OStatus.php:1648 #, php-format msgid "%s is now following %s." msgstr "" -#: src/Protocol/OStatus.php:1646 +#: src/Protocol/OStatus.php:1649 msgid "following" msgstr "" -#: src/Protocol/OStatus.php:1649 +#: src/Protocol/OStatus.php:1652 #, php-format msgid "%s stopped following %s." msgstr "" -#: src/Protocol/OStatus.php:1650 +#: src/Protocol/OStatus.php:1653 msgid "stopped following" msgstr "" @@ -10726,7 +10736,7 @@ msgstr "" msgid "%1$d %2$s ago" msgstr "" -#: src/Worker/Delivery.php:525 +#: src/Worker/Delivery.php:524 msgid "(no subject)" msgstr "" From 3b6c40e2e6ad59f09daef08cf09366c844edd23a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 15 Feb 2022 15:59:35 -0500 Subject: [PATCH 028/170] Check the existence of the `uid` field before accessing it in Module\Photo - Address https://github.com/friendica/friendica/issues/11218#issuecomment-1039512291 --- src/Module/Photo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Module/Photo.php b/src/Module/Photo.php index c67520b55..3d3110fd8 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -288,9 +288,10 @@ class Photo extends BaseModule } } - If (($contact['uid'] != 0) && empty($contact['photo']) && empty($contact['avatar'])) { + if (!empty($contact['uid']) && empty($contact['photo']) && empty($contact['avatar'])) { $contact = Contact::getByURL($contact['url'], false, ['avatar', 'photo', 'xmpp', 'addr']); } + if (!empty($contact['photo']) && !empty($contact['avatar'])) { // Fetch photo directly $resourceid = MPhoto::ridFromURI($contact['photo']); From 4e58c6981cf1e57ed0d07dfb174b6f27ef0736e3 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 15 Feb 2022 23:04:43 +0100 Subject: [PATCH 029/170] Don't use empty, but not null values for redis password and port --- src/Core/Cache/Type/RedisCache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Cache/Type/RedisCache.php b/src/Core/Cache/Type/RedisCache.php index a58936cfc..a3a5cf7c8 100644 --- a/src/Core/Cache/Type/RedisCache.php +++ b/src/Core/Cache/Type/RedisCache.php @@ -59,13 +59,13 @@ class RedisCache extends AbstractCache implements ICanCacheInMemory $redis_pw = $config->get('system', 'redis_password'); $redis_db = $config->get('system', 'redis_db', 0); - if (isset($redis_port) && !@$this->redis->connect($redis_host, $redis_port)) { + if (!empty($redis_port) && !@$this->redis->connect($redis_host, $redis_port)) { throw new CachePersistenceException('Expected Redis server at ' . $redis_host . ':' . $redis_port . ' isn\'t available'); } elseif (!@$this->redis->connect($redis_host)) { throw new CachePersistenceException('Expected Redis server at ' . $redis_host . ' isn\'t available'); } - if (isset($redis_pw) && !$this->redis->auth($redis_pw)) { + if (!empty($redis_pw) && !$this->redis->auth($redis_pw)) { throw new CachePersistenceException('Cannot authenticate redis server at ' . $redis_host . ':' . $redis_port); } From be240ca5000fa1bd3dd316d2dc7ad34ac53aa4d8 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 15 Feb 2022 23:10:41 +0100 Subject: [PATCH 030/170] Config Console Show 'NULL' for null-values --- src/Console/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/Config.php b/src/Console/Config.php index 0a38f607f..e32983a68 100644 --- a/src/Console/Config.php +++ b/src/Console/Config.php @@ -151,7 +151,7 @@ HELP; $this->out("{$cat}.{$key}[{$k}] => " . (is_array($v) ? implode(', ', $v) : $v)); } } else { - $this->out("{$cat}.{$key} => " . $value); + $this->out("{$cat}.{$key} => " . ($value ?? 'NULL')); } } From c4e40734df1ff39a4f5be5deeae57db5a39df973 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 15 Feb 2022 23:17:40 +0100 Subject: [PATCH 031/170] adapt test --- tests/src/Console/ConfigConsoleTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/Console/ConfigConsoleTest.php b/tests/src/Console/ConfigConsoleTest.php index dd7925ed9..eae622725 100644 --- a/tests/src/Console/ConfigConsoleTest.php +++ b/tests/src/Console/ConfigConsoleTest.php @@ -102,7 +102,7 @@ class ConfigConsoleTest extends ConsoleTest $console->setArgument(0, 'config'); $console->setArgument(1, 'test'); $txt = $this->dumpExecute($console); - self::assertEquals("config.test => \n", $txt); + self::assertEquals("config.test => NULL\n", $txt); } public function testSetArrayValue() From 33edfc6a5fd86ddb7486b36a66fa27f00edbb634 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Feb 2022 23:51:13 +0000 Subject: [PATCH 032/170] Fix for private communities --- src/Model/Item.php | 36 +++++++++++++++++++----------- src/Module/ActivityPub/Objects.php | 25 ++++++--------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 96cf5c488..69a967b2c 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1442,26 +1442,36 @@ class Item } $post = Post::selectFirst(['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'private'], ['uri-id' => $uriid, 'origin' => true]); - if (empty($post)) { - if (Post::exists(['uri-id' => $uriid, 'uid' => 0])) { - return 0; - } else { + if (!empty($post)) { + if (in_array($post['private'], [Item::PUBLIC, Item::UNLISTED])) { + return $post['uid']; + } + + $pcid = Contact::getPublicIdByUserId($uid); + if (empty($pcid)) { return null; } - } - if (in_array($post['private'], [Item::PUBLIC, Item::UNLISTED])) { - return $post['uid']; - } + foreach (Item::enumeratePermissions($post, true) as $receiver) { + if ($receiver == $pcid) { + return $post['uid']; + } + } - $pcid = Contact::getPublicIdByUserId($uid); - if (empty($pcid)) { return null; } - foreach (Item::enumeratePermissions($post, true) as $receiver) { - if ($receiver == $pcid) { - return $post['uid']; + if (Post::exists(['uri-id' => $uriid, 'uid' => 0])) { + return 0; + } + + // When the post belongs to a a forum then all forum users are allowed to access it + foreach (Tag::getByURIId($uriid, [Tag::EXCLUSIVE_MENTION]) as $tag) { + if (DBA::exists('contact', ['uid' => $uid, 'nurl' => Strings::normaliseLink($tag['url']), 'contact-type' => Contact::TYPE_COMMUNITY])) { + $target_uid = User::getIdForURL($tag['url']); + if (!empty($target_uid)) { + return $target_uid; + } } } diff --git a/src/Module/ActivityPub/Objects.php b/src/Module/ActivityPub/Objects.php index c085d8683..0a523ea43 100644 --- a/src/Module/ActivityPub/Objects.php +++ b/src/Module/ActivityPub/Objects.php @@ -70,9 +70,7 @@ class Objects extends BaseModule } } - $item = Post::selectFirst(['id', 'uid', 'origin', 'author-link', 'changed', 'private', 'psid', 'gravity', 'deleted', 'parent-uri-id'], - ['uri-id' => $itemuri['id']], ['order' => ['origin' => true]]); - + $item = Post::selectFirst([], ['uri-id' => $itemuri['id'], 'origin' => true]); if (!DBA::isResult($item)) { throw new HTTPException\NotFoundException(); } @@ -81,25 +79,16 @@ class Objects extends BaseModule if (!$validated) { $requester = HTTPSignature::getSigner('', $_SERVER); - if (!empty($requester) && $item['origin']) { - $requester_id = Contact::getIdForURL($requester, $item['uid']); - if (!empty($requester_id)) { - $permissionSets = DI::permissionSet()->selectByContactId($requester_id, $item['uid']); - $psids = array_merge($permissionSets->column('id'), [PermissionSet::PUBLIC]); - $validated = in_array($item['psid'], $psids); + if (!empty($requester)) { + $receivers = Item::enumeratePermissions($item, false); + + $validated = in_array(Contact::getIdForURL($requester, $item['uid']), $receivers); + if (!$validated) { + $validated = in_array(Contact::getIdForURL($requester), $receivers); } } } - if ($validated) { - // Valid items are original post or posted from this node (including in the case of a forum) - $validated = ($item['origin'] || (parse_url($item['author-link'], PHP_URL_HOST) == parse_url(DI::baseUrl()->get(), PHP_URL_HOST))); - - if (!$validated && $item['deleted']) { - $validated = Post::exists(['origin' => true, 'uri-id' => $item['parent-uri-id']]); - } - } - if (!$validated) { throw new HTTPException\NotFoundException(); } From b703d053ab069459809196e8e9c189086f461f85 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 16 Feb 2022 07:43:02 +0100 Subject: [PATCH 033/170] Note about breaking changes in private forums This adds a note/reminder to the CHANGELOG file about the breaking changes introduced in this version regarding the _private forums_. --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 96638b7e0..41929396c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ Version 2022.05 (unreleased) Friendica Core + Breaking: The distribution of _private forums_ was moved to ActivityPub, making them incompatible with older versions of Friendica [annando] Friendica Addons From 9ac24a0f362f16ff0ec30b05aaebf06516788e8a Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 16 Feb 2022 22:56:55 +0000 Subject: [PATCH 034/170] More rework to make private communities working --- mod/settings.php | 26 +++++++----- src/Model/Item.php | 30 ++++--------- src/Module/ActivityPub/Objects.php | 1 + src/Protocol/ActivityPub/Receiver.php | 9 ++++ src/Protocol/ActivityPub/Transmitter.php | 42 ++++++++++--------- src/Worker/Notifier.php | 15 ++++--- view/templates/settings/settings.tpl | 12 +++--- .../frio/templates/settings/settings.tpl | 11 ++--- 8 files changed, 79 insertions(+), 67 deletions(-) diff --git a/mod/settings.php b/mod/settings.php index 111e52330..c18a36704 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -239,7 +239,6 @@ function settings_post(App $a) $allow_location = ((!empty($_POST['allow_location']) && (intval($_POST['allow_location']) == 1)) ? 1: 0); $publish = ((!empty($_POST['profile_in_directory']) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0); $net_publish = ((!empty($_POST['profile_in_netdirectory']) && (intval($_POST['profile_in_netdirectory']) == 1)) ? 1: 0); - $old_visibility = ((!empty($_POST['visibility']) && (intval($_POST['visibility']) == 1)) ? 1 : 0); $account_type = ((!empty($_POST['account-type']) && (intval($_POST['account-type']))) ? intval($_POST['account-type']) : 0); $page_flags = ((!empty($_POST['page-flags']) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0); $blockwall = ((!empty($_POST['blockwall']) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted! @@ -361,16 +360,21 @@ function settings_post(App $a) DI::pConfig()->set(local_user(), 'system', 'unlisted', $unlisted); DI::pConfig()->set(local_user(), 'system', 'accessible-photos', $accessiblephotos); + if ($account_type == User::ACCOUNT_TYPE_COMMUNITY) { + $str_group_allow = ''; + $str_contact_allow = ''; + $str_group_deny = ''; + $str_contact_deny = ''; + + DI::pConfig()->set(local_user(), 'system', 'unlisted', true); + + $blockwall = true; + $blocktags = true; + $hide_friends = true; + } + if ($page_flags == User::PAGE_FLAGS_PRVGROUP) { - $hidewall = 1; - if (!$str_contact_allow && !$str_group_allow && !$str_contact_deny && !$str_group_deny) { - if ($def_gid) { - info(DI::l10n()->t('Private forum has no privacy permissions. Using default privacy group.')); - $str_group_allow = '<' . $def_gid . '>'; - } else { - notice(DI::l10n()->t('Private forum has no privacy permissions and no default privacy group.')); - } - } + $str_group_allow = '<' . Group::FOLLOWERS . '>'; } $fields = ['username' => $username, 'email' => $email, 'timezone' => $timezone, @@ -756,7 +760,7 @@ function settings_content(App $a) '$allowloc' => ['allow_location', DI::l10n()->t('Use Browser Location:'), ($user['allow_location'] == 1), ''], '$h_prv' => DI::l10n()->t('Security and Privacy Settings'), - '$visibility' => $profile['net-publish'], + '$is_community' => ($user['account-type'] == User::ACCOUNT_TYPE_COMMUNITY), '$maxreq' => ['maxreq', DI::l10n()->t('Maximum Friend Requests/Day:'), $maxreq , DI::l10n()->t("\x28to prevent spam abuse\x29")], '$profile_in_dir' => $profile_in_dir, '$profile_in_net_dir' => ['profile_in_netdirectory', DI::l10n()->t('Allow your profile to be searchable globally?'), $profile['net-publish'], DI::l10n()->t("Activate this setting if you want others to easily find and follow you. Your profile will be searchable on remote systems. This setting also determines whether Friendica will inform search engines that your profile should be indexed or not.") . $net_pub_desc], diff --git a/src/Model/Item.php b/src/Model/Item.php index 69a967b2c..318a8ab51 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1994,10 +1994,8 @@ class Item Logger::info('Community post will be distributed', ['uri' => $item['uri'], 'uid' => $uid, 'id' => $item_id, 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]); if ($owner['page-flags'] == User::PAGE_FLAGS_PRVGROUP) { - Group::getMembersForForum($owner['id']); - - $allow_cid = '<' . $owner['id'] . '>'; - $allow_gid = '<' . Group::getIdForForum($owner['id']) . '>'; + $allow_cid = ''; + $allow_gid = '<' . Group::FOLLOWERS . '>'; $deny_cid = ''; $deny_gid = ''; self::performActivity($item['id'], 'announce', $uid, $allow_cid, $allow_gid, $deny_cid, $deny_gid); @@ -3210,30 +3208,20 @@ class Item } /** - * Is the given item array a post that is sent as starting post to a forum? + * Does the given uri-id belongs to a post that is sent as starting post to a forum? * - * @param array $item - * @param array $owner + * @param int $uri_id * * @return boolean "true" when it is a forum post */ - public static function isForumPost(array $item, array $owner = []) + public static function isForumPost(int $uri_id) { - if (empty($owner)) { - $owner = User::getOwnerDataById($item['uid']); - if (empty($owner)) { - return false; + foreach (Tag::getByURIId($uri_id, [Tag::EXCLUSIVE_MENTION]) as $tag) { + if (DBA::exists('contact', ['uid' => 0, 'nurl' => Strings::normaliseLink($tag['url']), 'contact-type' => Contact::TYPE_COMMUNITY])) { + return true; } } - - if (($item['author-id'] == $item['owner-id']) || - ($owner['id'] == $item['contact-id']) || - ($item['uri-id'] != $item['parent-uri-id']) || - $item['origin']) { - return false; - } - - return Contact::isForum($item['contact-id']); + return false; } /** diff --git a/src/Module/ActivityPub/Objects.php b/src/Module/ActivityPub/Objects.php index 0a523ea43..f3a37b7da 100644 --- a/src/Module/ActivityPub/Objects.php +++ b/src/Module/ActivityPub/Objects.php @@ -81,6 +81,7 @@ class Objects extends BaseModule $requester = HTTPSignature::getSigner('', $_SERVER); if (!empty($requester)) { $receivers = Item::enumeratePermissions($item, false); + $receivers[] = $item['contact-id']; $validated = in_array(Contact::getIdForURL($requester, $item['uid']), $receivers); if (!$validated) { diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 7f08410f6..003cae0c9 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -667,6 +667,15 @@ class Receiver $uid = $receiver['uid']; } } + + // When we haven't found any user yet, we just chose a user who most likely could have access to the content + if (empty($uid)) { + $contact = Contact::selectFirst(['uid'], ['nurl' => Strings::normaliseLink($actor), 'rel' => [Contact::SHARING, Contact::FRIEND]]); + if (!empty($contact['uid'])) { + $uid = $contact['uid']; + } + } + return $uid; } diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 7be55898c..884f9430f 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -509,28 +509,33 @@ class Transmitter /** * Creates an array of permissions from an item thread * - * @param array $item Item array - * @param boolean $blindcopy addressing via "bcc" or "cc"? - * @param integer $last_id Last item id for adding receivers - * @param boolean $forum_post "true" means that we are sending content to a forum + * @param array $item Item array + * @param boolean $blindcopy addressing via "bcc" or "cc"? + * @param integer $last_id Last item id for adding receivers * * @return array with permission data * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ - private static function createPermissionBlockForItem($item, $blindcopy, $last_id = 0, $forum_post = false) + private static function createPermissionBlockForItem($item, $blindcopy, $last_id = 0) { if ($last_id == 0) { $last_id = $item['id']; } $always_bcc = false; + $is_forum = false; + $follower = ''; // Check if we should always deliver our stuff via BCC if (!empty($item['uid'])) { - $profile = User::getOwnerDataById($item['uid']); - if (!empty($profile)) { - $always_bcc = $profile['hide-friends']; + $owner = User::getOwnerDataById($item['uid']); + if (!empty($owner)) { + $always_bcc = $owner['hide-friends']; + $is_forum = ($owner['account-type'] == User::ACCOUNT_TYPE_COMMUNITY) && $owner['manually-approve']; + + $profile = APContact::getByURL($owner['url'], false); + $follower = $profile['followers'] ?? ''; } } @@ -613,7 +618,9 @@ class Transmitter } } - if (!$exclusive) { + if ($is_forum && !$exclusive && !empty($follower)) { + $data['cc'][] = $follower; + } elseif (!$exclusive) { foreach ($receiver_list as $receiver) { $contact = DBA::selectFirst('contact', ['url', 'hidden', 'network', 'protocol', 'gsid'], ['id' => $receiver, 'network' => Protocol::FEDERATED]); if (!DBA::isResult($contact) || !self::isAPContact($contact, $networks)) { @@ -652,9 +659,7 @@ class Transmitter } } elseif (!$exclusive) { // Public thread parent post always are directed to the followers. - // This mustn't be done by posts that are directed to forum servers via the exclusive mention. - // But possibly in that case we could add the "followers" collection of the forum to the message. - if (($item['private'] != Item::PRIVATE) && !$forum_post) { + if ($item['private'] != Item::PRIVATE) { $data['cc'][] = $actor_profile['followers']; } } @@ -820,18 +825,17 @@ class Transmitter /** * Fetches an array of inboxes for the given item and user * - * @param array $item Item array - * @param integer $uid User ID - * @param boolean $personal fetch personal inboxes - * @param integer $last_id Last item id for adding receivers - * @param boolean $forum_post "true" means that we are sending content to a forum + * @param array $item Item array + * @param integer $uid User ID + * @param boolean $personal fetch personal inboxes + * @param integer $last_id Last item id for adding receivers * @return array with inboxes * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ - public static function fetchTargetInboxes($item, $uid, $personal = false, $last_id = 0, $forum_post = false) + public static function fetchTargetInboxes($item, $uid, $personal = false, $last_id = 0) { - $permissions = self::createPermissionBlockForItem($item, true, $last_id, $forum_post); + $permissions = self::createPermissionBlockForItem($item, true, $last_id); if (empty($permissions)) { return []; } diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 3a5c7f13e..f79b46637 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -235,13 +235,13 @@ class Notifier } // Special treatment for forum posts - if (Item::isForumPost($target_item, $owner)) { + if (Item::isForumPost($target_item['uri-id'])) { $relay_to_owner = true; $direct_forum_delivery = true; } // Avoid that comments in a forum thread are sent to OStatus - if (Item::isForumPost($parent, $owner)) { + if (Item::isForumPost($parent['uri-id'])) { $direct_forum_delivery = true; } @@ -729,6 +729,14 @@ class Notifier $uid = $target_item['contact-uid'] ?: $target_item['uid']; + // Update the locally stored follower list when we deliver to a forum + foreach (Tag::getByURIId($target_item['uri-id'], [Tag::EXCLUSIVE_MENTION]) as $tag) { + $target_contact = Contact::getByURL(Strings::normaliseLink($tag['url']), null, [], $uid); + if (($target_contact['contact-type'] == Contact::TYPE_COMMUNITY) && $target_contact['manually-approve']) { + Group::getMembersForForum($target_contact['id']); + } + } + if ($target_item['origin']) { $inboxes = ActivityPub\Transmitter::fetchTargetInboxes($target_item, $uid); @@ -738,9 +746,6 @@ class Notifier } Logger::info('Origin item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.'); - } elseif (Item::isForumPost($target_item, $owner)) { - $inboxes = ActivityPub\Transmitter::fetchTargetInboxes($target_item, $uid, false, 0, true); - Logger::info('Forum item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.'); } elseif (!DBA::exists('conversation', ['item-uri' => $target_item['uri'], 'protocol' => Conversation::PARCEL_ACTIVITYPUB])) { Logger::info('Remote item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' is no AP post. It will not be distributed.'); return ['count' => 0, 'contacts' => []]; diff --git a/view/templates/settings/settings.tpl b/view/templates/settings/settings.tpl index c2ed1a942..c0e821ac7 100644 --- a/view/templates/settings/settings.tpl +++ b/view/templates/settings/settings.tpl @@ -39,28 +39,28 @@

{{$h_prv}}

- - - {{include file="field_input.tpl" field=$maxreq}} {{$profile_in_dir nofilter}} {{include file="field_checkbox.tpl" field=$profile_in_net_dir}} - {{include file="field_checkbox.tpl" field=$hide_friends}} + {{if not $is_community}}{{include file="field_checkbox.tpl" field=$hide_friends}}{{/if}} {{include file="field_checkbox.tpl" field=$hide_wall}} - {{include file="field_checkbox.tpl" field=$unlisted}} + {{if not $is_community}}{{include file="field_checkbox.tpl" field=$unlisted}}{{/if}} {{include file="field_checkbox.tpl" field=$accessiblephotos}} + {{if not $is_community}} {{include file="field_checkbox.tpl" field=$blockwall}} {{include file="field_checkbox.tpl" field=$blocktags}} + {{/if}} {{include file="field_checkbox.tpl" field=$unkmail}} {{include file="field_input.tpl" field=$cntunkmail}} {{$group_select nofilter}} - + {{if not $is_community}}

{{$permissions}}

{{$aclselect nofilter}} + {{/if}}
diff --git a/view/theme/frio/templates/settings/settings.tpl b/view/theme/frio/templates/settings/settings.tpl index bf129cc12..b9e105e88 100644 --- a/view/theme/frio/templates/settings/settings.tpl +++ b/view/theme/frio/templates/settings/settings.tpl @@ -70,28 +70,29 @@
- - - {{include file="field_input.tpl" field=$maxreq}} {{$profile_in_dir nofilter}} {{include file="field_checkbox.tpl" field=$profile_in_net_dir}} - {{include file="field_checkbox.tpl" field=$hide_friends}} + {{if not $is_community}}{{include file="field_checkbox.tpl" field=$hide_friends}}{{/if}} {{include file="field_checkbox.tpl" field=$hide_wall}} - {{include file="field_checkbox.tpl" field=$unlisted}} + {{if not $is_community}}{{include file="field_checkbox.tpl" field=$unlisted}}{{/if}} {{include file="field_checkbox.tpl" field=$accessiblephotos}} + {{if not $is_community}} {{include file="field_checkbox.tpl" field=$blockwall}} {{include file="field_checkbox.tpl" field=$blocktags}} + {{/if}} {{include file="field_checkbox.tpl" field=$unkmail}} {{include file="field_input.tpl" field=$cntunkmail}} {{$group_select nofilter}} + {{if not $is_community}}

{{$permissions}}

{{$aclselect nofilter}} + {{/if}}
- {{if $item.drop.dropping}}{{/if}} + {{if $item.drop && $item.drop.dropping}}{{/if}}
- {{if $item.drop.pagedrop}}{{/if}} + {{if $item.drop && $item.drop.pagedrop}}{{/if}}
diff --git a/view/templates/wall_thread.tpl b/view/templates/wall_thread.tpl index d0e3b51ea..763a68bde 100644 --- a/view/templates/wall_thread.tpl +++ b/view/templates/wall_thread.tpl @@ -121,9 +121,9 @@
{{/if}}
- {{if $item.drop.dropping}}{{/if}} + {{if $item.drop && $item.drop.dropping}}{{/if}}
- {{if $item.drop.pagedrop}}{{/if}} + {{if $item.drop && $item.drop.pagedrop}}{{/if}}
diff --git a/view/theme/frio/templates/search_item.tpl b/view/theme/frio/templates/search_item.tpl index 2fbff14d7..39e66751f 100644 --- a/view/theme/frio/templates/search_item.tpl +++ b/view/theme/frio/templates/search_item.tpl @@ -1,6 +1,6 @@ @@ -245,7 +245,7 @@ {{/if}} - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}}
  • {{$item.drop.delete}}
  • @@ -270,7 +270,7 @@ {{/if}} - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index 8f03cb5c9..55858d811 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -336,7 +336,7 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} {{* Put additional actions in a dropdown menu *}} - {{if $item.menu && ($item.edpost || $item.tagger || $item.filer || $item.pin || $item.star || $item.follow_thread || $item.ignore || $item.drop.dropping)}} + {{if $item.menu && ($item.edpost || $item.tagger || $item.filer || $item.pin || $item.star || $item.follow_thread || $item.ignore || ($item.drop && $item.drop.dropping))}} @@ -385,7 +385,7 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} - {{if ($item.edpost || $item.tagger || $item.filer || $item.pin || $item.star || $item.follow_thread) && ($item.ignore || $item.drop.dropping)}} + {{if ($item.edpost || $item.tagger || $item.filer || $item.pin || $item.star || $item.follow_thread) && ($item.ignore || ($item.drop && $item.drop.dropping))}} {{/if}} @@ -398,7 +398,7 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}}
  • {{$item.drop.delete}}
  • @@ -429,7 +429,7 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} @@ -506,7 +506,7 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} - {{if $item.edpost || $item.tagger || $item.filer || $item.pin || $item.star || $item.follow_thread || $item.ignore || $item.drop.dropping}} + {{if $item.edpost || $item.tagger || $item.filer || $item.pin || $item.star || $item.follow_thread || $item.ignore || ($item.drop && $item.drop.dropping)}} {{/if}} - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} diff --git a/view/theme/quattro/templates/search_item.tpl b/view/theme/quattro/templates/search_item.tpl index 903138874..b5c6af7e7 100644 --- a/view/theme/quattro/templates/search_item.tpl +++ b/view/theme/quattro/templates/search_item.tpl @@ -71,10 +71,10 @@
    - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}} {{$item.drop.delete}} {{/if}} {{if $item.edpost}} diff --git a/view/theme/quattro/templates/wall_item_tag.tpl b/view/theme/quattro/templates/wall_item_tag.tpl index 5f2021b3e..3aa9d3ad4 100644 --- a/view/theme/quattro/templates/wall_item_tag.tpl +++ b/view/theme/quattro/templates/wall_item_tag.tpl @@ -40,10 +40,10 @@ {{$item.ago}} {{$item.body_html nofilter}}
    - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}} {{$item.drop.delete}} {{/if}}
    diff --git a/view/theme/quattro/templates/wall_thread.tpl b/view/theme/quattro/templates/wall_thread.tpl index 29dae72b4..1382222c1 100644 --- a/view/theme/quattro/templates/wall_thread.tpl +++ b/view/theme/quattro/templates/wall_thread.tpl @@ -145,10 +145,10 @@
    - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}} {{$item.drop.delete}} {{/if}} {{if $item.edpost}} diff --git a/view/theme/smoothly/templates/search_item.tpl b/view/theme/smoothly/templates/search_item.tpl index 7675c2db1..94d713267 100644 --- a/view/theme/smoothly/templates/search_item.tpl +++ b/view/theme/smoothly/templates/search_item.tpl @@ -26,9 +26,9 @@
    - {{if $item.drop.dropping}}{{/if}} + {{if $item.drop && $item.drop.dropping}}{{/if}}
    - {{if $item.drop.pagedrop}}{{/if}} + {{if $item.drop && $item.drop.pagedrop}}{{/if}}
    diff --git a/view/theme/smoothly/templates/wall_thread.tpl b/view/theme/smoothly/templates/wall_thread.tpl index 773938f3c..53602cc8f 100644 --- a/view/theme/smoothly/templates/wall_thread.tpl +++ b/view/theme/smoothly/templates/wall_thread.tpl @@ -135,12 +135,12 @@ {{/if}}
    - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}} {{/if}}
    - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} diff --git a/view/theme/vier/templates/search_item.tpl b/view/theme/vier/templates/search_item.tpl index 44fb6804d..2441c80fe 100644 --- a/view/theme/vier/templates/search_item.tpl +++ b/view/theme/vier/templates/search_item.tpl @@ -75,10 +75,10 @@
    - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}} {{$item.drop.delete}} {{/if}} {{if $item.edpost}} diff --git a/view/theme/vier/templates/wall_item_tag.tpl b/view/theme/vier/templates/wall_item_tag.tpl index 01207ab11..c12cb7085 100644 --- a/view/theme/vier/templates/wall_item_tag.tpl +++ b/view/theme/vier/templates/wall_item_tag.tpl @@ -40,10 +40,10 @@ {{$item.ago}} {{$item.body_html nofilter}}
    - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}} {{$item.drop.delete}} {{/if}}
    diff --git a/view/theme/vier/templates/wall_thread.tpl b/view/theme/vier/templates/wall_thread.tpl index f2bd02e7e..7d851d001 100644 --- a/view/theme/vier/templates/wall_thread.tpl +++ b/view/theme/vier/templates/wall_thread.tpl @@ -162,10 +162,10 @@
    - {{if $item.drop.pagedrop}} + {{if $item.drop && $item.drop.pagedrop}} {{/if}} - {{if $item.drop.dropping}} + {{if $item.drop && $item.drop.dropping}} {{$item.drop.delete}} {{/if}} {{if $item.edpost}} From 0209892631892486e4ee000328c7e8e8f15c839c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 20 Feb 2022 14:10:57 +0100 Subject: [PATCH 058/170] Apply suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/Model/Group.php | 6 +++++- src/Module/Api/Mastodon/Lists/Accounts.php | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Model/Group.php b/src/Model/Group.php index da77335f1..fa41d2646 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -358,14 +358,18 @@ class Group throw new HTTPException\NotFoundException('Group not found.'); } + $contactIds = []; + foreach ($contacts as $cid) { $cdata = Contact::getPublicAndUserContactID($cid, $group['uid']); if (empty($cdata['user'])) { throw new HTTPException\NotFoundException('Invalid contact.'); } - DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $cdata['user']]); + $contactIds[] = $cdata['user']; } + + DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $contactIds]); } /** diff --git a/src/Module/Api/Mastodon/Lists/Accounts.php b/src/Module/Api/Mastodon/Lists/Accounts.php index 8d27207fc..413cacae2 100644 --- a/src/Module/Api/Mastodon/Lists/Accounts.php +++ b/src/Module/Api/Mastodon/Lists/Accounts.php @@ -45,6 +45,7 @@ class Accounts extends BaseApi if (empty($request['account_ids']) || empty($this->parameters['id'])) { DI::mstdnError()->UnprocessableEntity(); } + return Group::removeMembers($this->parameters['id'], $request['account_ids']); } @@ -59,6 +60,7 @@ class Accounts extends BaseApi if (empty($request['account_ids']) || empty($this->parameters['id'])) { DI::mstdnError()->UnprocessableEntity(); } + return Group::addMembers($this->parameters['id'], $request['account_ids']); } From ff439272b9105ad2132c693e7a0947fff05b453d Mon Sep 17 00:00:00 2001 From: k-alin <63866963+k-alin@users.noreply.github.com> Date: Sun, 20 Feb 2022 17:45:51 +0100 Subject: [PATCH 059/170] mysql connection via socket if location of mysqld.sock was specified --- src/Database/Database.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Database/Database.php b/src/Database/Database.php index effed6e5e..79415c9f4 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -126,7 +126,7 @@ class Database if (!$this->configCache->get('database', 'disable_pdo') && class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) { $this->driver = self::PDO; - $connect = "mysql:host=" . $server . ";dbname=" . $db . ";unix_socket=" . $socket; + $connect = "mysql:host=" . $server . ";dbname=" . $db; if ($port > 0) { $connect .= ";port=" . $port; @@ -135,8 +135,12 @@ class Database if ($charset) { $connect .= ";charset=" . $charset; } - - try { + + if ($socket) { + $connect .= ";$unix_socket=" . $socket; + } + + try { $this->connection = @new PDO($connect, $user, $pass, [PDO::ATTR_PERSISTENT => $persistent]); $this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, $this->pdo_emulate_prepares); $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); @@ -150,9 +154,9 @@ class Database $this->driver = self::MYSQLI; if ($port > 0) { - $this->connection = @new mysqli($server, $user, $pass, $db, $port, $socket); + $this->connection = @new mysqli($server, $user, $pass, $db, $port); } else { - $this->connection = @new mysqli($server, $user, $pass, $db, $socket); + $this->connection = @new mysqli($server, $user, $pass, $db); } if (!mysqli_connect_errno()) { @@ -161,6 +165,11 @@ class Database if ($charset) { $this->connection->set_charset($charset); } + + if ($socket) { + $this->connection->set_socket($socket); + } + } } From 39e820e6a3ffaaec82f47b493c1b6b45f768a303 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Feb 2022 19:25:55 +0000 Subject: [PATCH 060/170] Display the post receivers --- src/Module/PermissionTooltip.php | 60 ++++++++++++++++++++--- src/Object/Post.php | 34 ++++++++++--- static/settings.config.php | 4 ++ view/theme/frio/css/style.css | 5 +- view/theme/frio/templates/wall_thread.tpl | 19 ++++--- 5 files changed, 100 insertions(+), 22 deletions(-) diff --git a/src/Module/PermissionTooltip.php b/src/Module/PermissionTooltip.php index 71ce2beee..f6722c984 100644 --- a/src/Module/PermissionTooltip.php +++ b/src/Module/PermissionTooltip.php @@ -25,8 +25,8 @@ use Friendica\Core\Hook; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Group; -use Friendica\Model\Item; use Friendica\Model\Post; +use Friendica\Model\Tag; use Friendica\Network\HTTPException; /** @@ -46,7 +46,7 @@ class PermissionTooltip extends \Friendica\BaseModule $condition = ['id' => $referenceId]; if ($type == 'item') { - $fields = ['uid', 'psid', 'private']; + $fields = ['uid', 'psid', 'private', 'uri-id']; $model = Post::selectFirst($fields, $condition); } else { $fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']; @@ -72,13 +72,18 @@ class PermissionTooltip extends \Friendica\BaseModule // Kept for backwards compatiblity Hook::callAll('lockview_content', $model); + if ($type == 'item') { + $receivers = $this->fetchReceivers($model['uri-id']); + } else { + $receivers = ''; + } + if ($model['uid'] != local_user() || - isset($model['private']) - && $model['private'] == Item::PRIVATE - && empty($model['allow_cid']) + empty($model['allow_cid']) && empty($model['allow_gid']) && empty($model['deny_cid']) - && empty($model['deny_gid'])) + && empty($model['deny_gid']) + && empty($receivers)) { echo DI::l10n()->t('Remote privacy information not available.'); exit; @@ -136,7 +141,48 @@ class PermissionTooltip extends \Friendica\BaseModule $l[] = '' . $contact['name'] . ''; } - echo $o . implode(', ', $l); + if (!empty($l)) { + echo $o . implode(', ', $l); + } else { + echo $o . $receivers; + } + exit(); } + + /** + * Fetch a list of receivers + * + * @param int $uriId + * @return string + */ + private function fetchReceivers(int $uriId):string + { + // We only fetch "to" and "cc", because "bcc" should never be displayed + $receivers = []; + foreach (Tag::getByURIId($uriId, [Tag::TO, Tag::CC]) as $receiver) { + $receivers[$receiver['type']][] = $receiver['name']; + } + + $output = ''; + + foreach ($receivers as $type => $receiver) { + $max = DI::config()->get('system', 'max_receivers'); + $total = count($receiver); + if ($total > $max) { + $receiver = array_slice($receiver, 0, $max); + $receiver[] = DI::l10n()->t('%d more', $total - $max); + } + switch ($type) { + case Tag::TO: + $output .= DI::l10n()->t('To: %s
    ', implode(', ', $receiver)); + break; + case Tag::CC: + $output .= DI::l10n()->t('CC: %s
    ', implode(', ', $receiver)); + break; + } + } + + return $output; + } } diff --git a/src/Object/Post.php b/src/Object/Post.php index 17303bd62..bbd1e9ce1 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -121,6 +121,29 @@ class Post } } + /** + * Fetch the privacy of the post + * + * @param array $item + * @return string + */ + private function fetchPrivacy(array $item):string + { + switch ($item['private']) { + case Item::PRIVATE: + $output = DI::l10n()->t('Private Message'); + break; + case Item::PUBLIC: + $output = DI::l10n()->t('Public Message'); + break; + case Item::UNLISTED: + $output = DI::l10n()->t('Unlisted Message'); + break; + } + + return $output; + } + /** * Get data in a form usable by a conversation template * @@ -170,12 +193,9 @@ class Post $conv = $this->getThread(); - $lock = ((($item['private'] == Item::PRIVATE) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) - || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) - ? DI::l10n()->t('Private Message') - : false); - - $connector = !$item['global'] ? DI::l10n()->t('Connector Message') : false; + $privacy = $this->fetchPrivacy($item); + $lock = ($item['private'] == Item::PRIVATE) ? $privacy : false; + $connector = !in_array($item['network'], Protocol::NATIVE_SUPPORT) ? DI::l10n()->t('Connector Message') : false; $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE; $announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]); @@ -463,6 +483,8 @@ class Post 'app' => $item['app'], 'created' => $ago, 'lock' => $lock, + 'private' => $item['private'], + 'privacy' => $privacy, 'connector' => $connector, 'location_html' => $location_html, 'indent' => $indent, diff --git a/static/settings.config.php b/static/settings.config.php index 24fce52f2..ea7558e5f 100644 --- a/static/settings.config.php +++ b/static/settings.config.php @@ -140,6 +140,10 @@ return [ // If you don't want to set a maximum length, set to -1. 'max_image_length' => -1, + // max_receivers (Integer) + // The maximum number of displayed receivers of posts + 'max_receivers' => 10, + // maximagesize (Integer) // Maximum size in bytes of an uploaded photo. 'maximagesize' => 800000, diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index f96239c30..c619ee678 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -1757,8 +1757,7 @@ blockquote.shared_content { font-weight: 500; color: $font_color_darker; } -.media .media-body .addional-info a, -.media .media-body h5.media-heading > a { +.media .media-body .addional-info a { display: block; } .media .contact-info-comment { @@ -1769,7 +1768,7 @@ blockquote.shared_content { margin: 0 0 5px; } .media-heading { - margin: 0 0 5px; + margin: 0px; } .wall-item-name, .shared-author { diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index 55858d811..c57ea091b 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -158,12 +158,12 @@ as the value of $top_child_total (this is done at the end of this file) {{$item.owner_name}} {{/if}} - {{if $item.lock}} - -   + {{if $item.connector}} + + {{else}} + +   - {{elseif $item.connector}} - {{/if}} @@ -221,7 +221,15 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} {{* End of if $item.thread_level != 1 *}}
    From a0b6bdc8de47e4d0add21b36c18b07b3738a40cd Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Feb 2022 19:29:48 +0000 Subject: [PATCH 061/170] Updated messages.po --- view/lang/C/messages.po | 234 +++++++++++++++++++++++----------------- 1 file changed, 136 insertions(+), 98 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 7b8fb5ea0..39a263379 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.05-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-19 13:54+0000\n" +"POT-Creation-Date: 2022-02-20 19:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,6 +18,26 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" +#: local/test.php:116 src/Module/PermissionTooltip.php:174 +#, php-format +msgid "%d more" +msgstr "" + +#: local/test.php:120 +#, php-format +msgid "To: %s" +msgstr "" + +#: local/test.php:123 +#, php-format +msgid "CC: %s" +msgstr "" + +#: local/test.php:126 +#, php-format +msgid "BCC: %s" +msgstr "" + #: mod/cal.php:44 mod/cal.php:48 mod/follow.php:39 mod/redir.php:34 #: mod/redir.php:175 src/Module/Conversation/Community.php:181 #: src/Module/Debug/ItemBody.php:37 src/Module/Diaspora/Receive.php:57 @@ -163,7 +183,7 @@ msgid "Save" msgstr "" #: mod/editpost.php:92 mod/photos.php:1344 src/Content/Conversation.php:326 -#: src/Module/Contact/Poke.php:176 src/Object/Post.php:960 +#: src/Module/Contact/Poke.php:176 src/Object/Post.php:982 msgid "Loading..." msgstr "" @@ -229,7 +249,7 @@ msgstr "" #: mod/editpost.php:107 mod/message.php:200 mod/message.php:358 #: mod/photos.php:1495 mod/wallmessage.php:142 src/Content/Conversation.php:355 #: src/Content/Conversation.php:690 src/Module/Item/Compose.php:165 -#: src/Object/Post.php:498 +#: src/Object/Post.php:520 msgid "Please wait" msgstr "" @@ -261,7 +281,7 @@ msgstr "" #: mod/editpost.php:128 mod/events.php:517 mod/photos.php:1343 #: mod/photos.php:1399 mod/photos.php:1473 src/Content/Conversation.php:370 -#: src/Module/Item/Compose.php:160 src/Object/Post.php:970 +#: src/Module/Item/Compose.php:160 src/Object/Post.php:992 msgid "Preview" msgstr "" @@ -273,37 +293,37 @@ msgid "Cancel" msgstr "" #: mod/editpost.php:134 src/Content/Conversation.php:331 -#: src/Module/Item/Compose.php:151 src/Object/Post.php:961 +#: src/Module/Item/Compose.php:151 src/Object/Post.php:983 msgid "Bold" msgstr "" #: mod/editpost.php:135 src/Content/Conversation.php:332 -#: src/Module/Item/Compose.php:152 src/Object/Post.php:962 +#: src/Module/Item/Compose.php:152 src/Object/Post.php:984 msgid "Italic" msgstr "" #: mod/editpost.php:136 src/Content/Conversation.php:333 -#: src/Module/Item/Compose.php:153 src/Object/Post.php:963 +#: src/Module/Item/Compose.php:153 src/Object/Post.php:985 msgid "Underline" msgstr "" #: mod/editpost.php:137 src/Content/Conversation.php:334 -#: src/Module/Item/Compose.php:154 src/Object/Post.php:964 +#: src/Module/Item/Compose.php:154 src/Object/Post.php:986 msgid "Quote" msgstr "" #: mod/editpost.php:138 src/Content/Conversation.php:335 -#: src/Module/Item/Compose.php:155 src/Object/Post.php:965 +#: src/Module/Item/Compose.php:155 src/Object/Post.php:987 msgid "Code" msgstr "" #: mod/editpost.php:139 src/Content/Conversation.php:337 -#: src/Module/Item/Compose.php:157 src/Object/Post.php:967 +#: src/Module/Item/Compose.php:157 src/Object/Post.php:989 msgid "Link" msgstr "" #: mod/editpost.php:140 src/Content/Conversation.php:338 -#: src/Module/Item/Compose.php:158 src/Object/Post.php:968 +#: src/Module/Item/Compose.php:158 src/Object/Post.php:990 msgid "Link or Media" msgstr "" @@ -411,7 +431,7 @@ msgstr "" #: src/Module/Install.php:252 src/Module/Install.php:294 #: src/Module/Install.php:331 src/Module/Invite.php:177 #: src/Module/Item/Compose.php:150 src/Module/Profile/Profile.php:247 -#: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:959 +#: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:981 #: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160 #: view/theme/quattro/config.php:71 view/theme/vier/config.php:119 msgid "Submit" @@ -1066,16 +1086,16 @@ msgstr "" #: mod/photos.php:1339 mod/photos.php:1395 mod/photos.php:1469 #: src/Module/Contact.php:544 src/Module/Item/Compose.php:148 -#: src/Object/Post.php:956 +#: src/Object/Post.php:978 msgid "This is you" msgstr "" #: mod/photos.php:1341 mod/photos.php:1397 mod/photos.php:1471 -#: src/Object/Post.php:492 src/Object/Post.php:958 +#: src/Object/Post.php:514 src/Object/Post.php:980 msgid "Comment" msgstr "" -#: mod/photos.php:1430 src/Content/Conversation.php:615 src/Object/Post.php:227 +#: mod/photos.php:1430 src/Content/Conversation.php:615 src/Object/Post.php:247 msgid "Select" msgstr "" @@ -1085,19 +1105,19 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1492 src/Object/Post.php:349 +#: mod/photos.php:1492 src/Object/Post.php:369 msgid "Like" msgstr "" -#: mod/photos.php:1493 src/Object/Post.php:349 +#: mod/photos.php:1493 src/Object/Post.php:369 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1494 src/Object/Post.php:350 +#: mod/photos.php:1494 src/Object/Post.php:370 msgid "Dislike" msgstr "" -#: mod/photos.php:1496 src/Object/Post.php:350 +#: mod/photos.php:1496 src/Object/Post.php:370 msgid "I don't like this (toggle)" msgstr "" @@ -1465,7 +1485,7 @@ msgstr "" msgid "Unable to find your profile. Please contact your admin." msgstr "" -#: mod/settings.php:664 src/Content/Widget.php:526 +#: mod/settings.php:664 src/Content/Widget.php:523 msgid "Account Types" msgstr "" @@ -2157,8 +2177,8 @@ msgid "All contacts" msgstr "" #: src/BaseModule.php:409 src/Content/Widget.php:231 src/Core/ACL.php:193 -#: src/Module/Contact.php:367 src/Module/PermissionTooltip.php:98 -#: src/Module/PermissionTooltip.php:120 +#: src/Module/Contact.php:367 src/Module/PermissionTooltip.php:103 +#: src/Module/PermissionTooltip.php:125 msgid "Followers" msgstr "" @@ -2484,7 +2504,7 @@ msgid "Visible to everybody" msgstr "" #: src/Content/Conversation.php:308 src/Module/Item/Compose.php:159 -#: src/Object/Post.php:969 +#: src/Object/Post.php:991 msgid "Please enter a image/video/audio/webpage URL:" msgstr "" @@ -2508,12 +2528,12 @@ msgstr "" msgid "New Post" msgstr "" -#: src/Content/Conversation.php:325 src/Object/Post.php:475 +#: src/Content/Conversation.php:325 src/Object/Post.php:497 msgid "Share" msgstr "" #: src/Content/Conversation.php:336 src/Module/Item/Compose.php:156 -#: src/Object/Post.php:966 +#: src/Object/Post.php:988 msgid "Image" msgstr "" @@ -2525,21 +2545,21 @@ msgstr "" msgid "Scheduled at" msgstr "" -#: src/Content/Conversation.php:651 src/Object/Post.php:448 -#: src/Object/Post.php:449 +#: src/Content/Conversation.php:651 src/Object/Post.php:468 +#: src/Object/Post.php:469 #, php-format msgid "View %s's profile @ %s" msgstr "" -#: src/Content/Conversation.php:664 src/Object/Post.php:436 +#: src/Content/Conversation.php:664 src/Object/Post.php:456 msgid "Categories:" msgstr "" -#: src/Content/Conversation.php:665 src/Object/Post.php:437 +#: src/Content/Conversation.php:665 src/Object/Post.php:457 msgid "Filed under:" msgstr "" -#: src/Content/Conversation.php:673 src/Object/Post.php:462 +#: src/Content/Conversation.php:673 src/Object/Post.php:482 #, php-format msgid "%s from %s" msgstr "" @@ -2699,7 +2719,7 @@ msgid "Display membership date in profile" msgstr "" #: src/Content/ForumManager.php:145 src/Content/Nav.php:239 -#: src/Content/Text/HTML.php:896 src/Content/Widget.php:523 +#: src/Content/Text/HTML.php:896 src/Content/Widget.php:520 msgid "Forums" msgstr "" @@ -2707,12 +2727,12 @@ msgstr "" msgid "External link to forum" msgstr "" -#: src/Content/ForumManager.php:150 src/Content/Widget.php:502 +#: src/Content/ForumManager.php:150 src/Content/Widget.php:499 msgid "show less" msgstr "" -#: src/Content/ForumManager.php:151 src/Content/Widget.php:404 -#: src/Content/Widget.php:503 +#: src/Content/ForumManager.php:151 src/Content/Widget.php:401 +#: src/Content/Widget.php:500 msgid "show more" msgstr "" @@ -2772,7 +2792,7 @@ msgstr "" msgid "Ignore" msgstr "" -#: src/Content/Item.php:443 src/Object/Post.php:423 +#: src/Content/Item.php:443 src/Object/Post.php:443 msgid "Languages" msgstr "" @@ -3201,38 +3221,38 @@ msgstr "" msgid "Saved Folders" msgstr "" -#: src/Content/Widget.php:311 src/Content/Widget.php:345 +#: src/Content/Widget.php:311 src/Content/Widget.php:342 msgid "Everything" msgstr "" -#: src/Content/Widget.php:343 +#: src/Content/Widget.php:340 msgid "Categories" msgstr "" -#: src/Content/Widget.php:400 +#: src/Content/Widget.php:397 #, php-format msgid "%d contact in common" msgid_plural "%d contacts in common" msgstr[0] "" msgstr[1] "" -#: src/Content/Widget.php:496 +#: src/Content/Widget.php:493 msgid "Archives" msgstr "" -#: src/Content/Widget.php:520 +#: src/Content/Widget.php:517 msgid "Persons" msgstr "" -#: src/Content/Widget.php:521 +#: src/Content/Widget.php:518 msgid "Organisations" msgstr "" -#: src/Content/Widget.php:522 src/Model/Contact.php:1472 +#: src/Content/Widget.php:519 src/Model/Contact.php:1472 msgid "News" msgstr "" -#: src/Content/Widget.php:527 src/Module/Admin/BaseUsers.php:51 +#: src/Content/Widget.php:524 src/Module/Admin/BaseUsers.php:51 msgid "All" msgstr "" @@ -3305,8 +3325,8 @@ msgstr "" msgid "Yourself" msgstr "" -#: src/Core/ACL.php:200 src/Module/PermissionTooltip.php:104 -#: src/Module/PermissionTooltip.php:126 +#: src/Core/ACL.php:200 src/Module/PermissionTooltip.php:109 +#: src/Module/PermissionTooltip.php:131 msgid "Mutuals" msgstr "" @@ -7095,7 +7115,7 @@ msgid "Only show blocked contacts" msgstr "" #: src/Module/Contact.php:330 src/Module/Contact.php:377 -#: src/Object/Post.php:309 +#: src/Object/Post.php:329 msgid "Ignored" msgstr "" @@ -7646,7 +7666,7 @@ msgstr "" msgid "Posts that mention or involve you" msgstr "" -#: src/Module/Conversation/Network.php:277 src/Object/Post.php:321 +#: src/Module/Conversation/Network.php:277 src/Object/Post.php:341 msgid "Starred" msgstr "" @@ -8568,14 +8588,24 @@ msgstr "" msgid "Model not found" msgstr "" -#: src/Module/PermissionTooltip.php:83 +#: src/Module/PermissionTooltip.php:88 msgid "Remote privacy information not available." msgstr "" -#: src/Module/PermissionTooltip.php:92 +#: src/Module/PermissionTooltip.php:97 msgid "Visible to:" msgstr "" +#: src/Module/PermissionTooltip.php:178 +#, php-format +msgid "To: %s
    " +msgstr "" + +#: src/Module/PermissionTooltip.php:181 +#, php-format +msgid "CC: %s
    " +msgstr "" + #: src/Module/Photo.php:123 msgid "The Photo is not available." msgstr "" @@ -10397,193 +10427,201 @@ msgstr "" msgid "%s posted an update." msgstr "" -#: src/Object/Post.php:147 -msgid "This entry was edited" -msgstr "" - -#: src/Object/Post.php:175 +#: src/Object/Post.php:134 msgid "Private Message" msgstr "" -#: src/Object/Post.php:178 +#: src/Object/Post.php:137 +msgid "Public Message" +msgstr "" + +#: src/Object/Post.php:140 +msgid "Unlisted Message" +msgstr "" + +#: src/Object/Post.php:170 +msgid "This entry was edited" +msgstr "" + +#: src/Object/Post.php:198 msgid "Connector Message" msgstr "" -#: src/Object/Post.php:193 src/Object/Post.php:195 +#: src/Object/Post.php:213 src/Object/Post.php:215 msgid "Edit" msgstr "" -#: src/Object/Post.php:215 +#: src/Object/Post.php:235 msgid "Pinned item" msgstr "" -#: src/Object/Post.php:219 +#: src/Object/Post.php:239 msgid "Delete globally" msgstr "" -#: src/Object/Post.php:219 +#: src/Object/Post.php:239 msgid "Remove locally" msgstr "" -#: src/Object/Post.php:235 +#: src/Object/Post.php:255 #, php-format msgid "Block %s" msgstr "" -#: src/Object/Post.php:240 +#: src/Object/Post.php:260 msgid "Save to folder" msgstr "" -#: src/Object/Post.php:274 +#: src/Object/Post.php:294 msgid "I will attend" msgstr "" -#: src/Object/Post.php:274 +#: src/Object/Post.php:294 msgid "I will not attend" msgstr "" -#: src/Object/Post.php:274 +#: src/Object/Post.php:294 msgid "I might attend" msgstr "" -#: src/Object/Post.php:304 +#: src/Object/Post.php:324 msgid "Ignore thread" msgstr "" -#: src/Object/Post.php:305 +#: src/Object/Post.php:325 msgid "Unignore thread" msgstr "" -#: src/Object/Post.php:306 +#: src/Object/Post.php:326 msgid "Toggle ignore status" msgstr "" -#: src/Object/Post.php:316 +#: src/Object/Post.php:336 msgid "Add star" msgstr "" -#: src/Object/Post.php:317 +#: src/Object/Post.php:337 msgid "Remove star" msgstr "" -#: src/Object/Post.php:318 +#: src/Object/Post.php:338 msgid "Toggle star status" msgstr "" -#: src/Object/Post.php:329 +#: src/Object/Post.php:349 msgid "Pin" msgstr "" -#: src/Object/Post.php:330 +#: src/Object/Post.php:350 msgid "Unpin" msgstr "" -#: src/Object/Post.php:331 +#: src/Object/Post.php:351 msgid "Toggle pin status" msgstr "" -#: src/Object/Post.php:334 +#: src/Object/Post.php:354 msgid "Pinned" msgstr "" -#: src/Object/Post.php:339 +#: src/Object/Post.php:359 msgid "Add tag" msgstr "" -#: src/Object/Post.php:352 +#: src/Object/Post.php:372 msgid "Quote share this" msgstr "" -#: src/Object/Post.php:352 +#: src/Object/Post.php:372 msgid "Quote Share" msgstr "" -#: src/Object/Post.php:355 +#: src/Object/Post.php:375 msgid "Reshare this" msgstr "" -#: src/Object/Post.php:355 +#: src/Object/Post.php:375 msgid "Reshare" msgstr "" -#: src/Object/Post.php:356 +#: src/Object/Post.php:376 msgid "Cancel your Reshare" msgstr "" -#: src/Object/Post.php:356 +#: src/Object/Post.php:376 msgid "Unshare" msgstr "" -#: src/Object/Post.php:401 +#: src/Object/Post.php:421 #, php-format msgid "%s (Received %s)" msgstr "" -#: src/Object/Post.php:406 +#: src/Object/Post.php:426 msgid "Comment this item on your system" msgstr "" -#: src/Object/Post.php:406 +#: src/Object/Post.php:426 msgid "Remote comment" msgstr "" -#: src/Object/Post.php:450 +#: src/Object/Post.php:470 msgid "to" msgstr "" -#: src/Object/Post.php:451 +#: src/Object/Post.php:471 msgid "via" msgstr "" -#: src/Object/Post.php:452 +#: src/Object/Post.php:472 msgid "Wall-to-Wall" msgstr "" -#: src/Object/Post.php:453 +#: src/Object/Post.php:473 msgid "via Wall-To-Wall:" msgstr "" -#: src/Object/Post.php:493 +#: src/Object/Post.php:515 #, php-format msgid "Reply to %s" msgstr "" -#: src/Object/Post.php:496 +#: src/Object/Post.php:518 msgid "More" msgstr "" -#: src/Object/Post.php:514 +#: src/Object/Post.php:536 msgid "Notifier task is pending" msgstr "" -#: src/Object/Post.php:515 +#: src/Object/Post.php:537 msgid "Delivery to remote servers is pending" msgstr "" -#: src/Object/Post.php:516 +#: src/Object/Post.php:538 msgid "Delivery to remote servers is underway" msgstr "" -#: src/Object/Post.php:517 +#: src/Object/Post.php:539 msgid "Delivery to remote servers is mostly done" msgstr "" -#: src/Object/Post.php:518 +#: src/Object/Post.php:540 msgid "Delivery to remote servers is done" msgstr "" -#: src/Object/Post.php:538 +#: src/Object/Post.php:560 #, php-format msgid "%d comment" msgid_plural "%d comments" msgstr[0] "" msgstr[1] "" -#: src/Object/Post.php:539 +#: src/Object/Post.php:561 msgid "Show more" msgstr "" -#: src/Object/Post.php:540 +#: src/Object/Post.php:562 msgid "Show fewer" msgstr "" From 2321c7a55bc5ca91a971329b2ec7dad96fc85852 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Feb 2022 20:47:08 +0000 Subject: [PATCH 062/170] Updated messages.po --- src/Database/PostUpdate.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Database/PostUpdate.php b/src/Database/PostUpdate.php index 777d54196..9dbb0a948 100644 --- a/src/Database/PostUpdate.php +++ b/src/Database/PostUpdate.php @@ -1039,7 +1039,8 @@ class PostUpdate Logger::info('Start', ['uri-id' => $id]); $start_id = $id; - $rows = 0; + $rows = 0; + $received = ''; $conversations = DBA::p("SELECT `post-view`.`uri-id`, `conversation`.`source`, `conversation`.`received` FROM `conversation` INNER JOIN `post-view` ON `post-view`.`uri` = `conversation`.`item-uri` From cec9c6d1a6c1e98b6cd5728fb329f6c60935cd10 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Feb 2022 20:50:50 +0000 Subject: [PATCH 063/170] Updated messages.po - again --- view/lang/C/messages.po | 47 ++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 39a263379..93b3f3731 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.05-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-20 19:29+0000\n" +"POT-Creation-Date: 2022-02-20 20:50+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,26 +18,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" -#: local/test.php:116 src/Module/PermissionTooltip.php:174 -#, php-format -msgid "%d more" -msgstr "" - -#: local/test.php:120 -#, php-format -msgid "To: %s" -msgstr "" - -#: local/test.php:123 -#, php-format -msgid "CC: %s" -msgstr "" - -#: local/test.php:126 -#, php-format -msgid "BCC: %s" -msgstr "" - #: mod/cal.php:44 mod/cal.php:48 mod/follow.php:39 mod/redir.php:34 #: mod/redir.php:175 src/Module/Conversation/Community.php:181 #: src/Module/Debug/ItemBody.php:37 src/Module/Diaspora/Receive.php:57 @@ -3191,7 +3171,7 @@ msgstr "" msgid "Local Directory" msgstr "" -#: src/Content/Widget.php:207 src/Model/Group.php:508 +#: src/Content/Widget.php:207 src/Model/Group.php:570 #: src/Module/Contact.php:354 src/Module/Welcome.php:76 msgid "Groups" msgstr "" @@ -4228,40 +4208,40 @@ msgid "" "not what you intended, please create another group with a different name." msgstr "" -#: src/Model/Group.php:424 +#: src/Model/Group.php:486 msgid "Default privacy group for new contacts" msgstr "" -#: src/Model/Group.php:456 +#: src/Model/Group.php:518 msgid "Everybody" msgstr "" -#: src/Model/Group.php:475 +#: src/Model/Group.php:537 msgid "edit" msgstr "" -#: src/Model/Group.php:507 +#: src/Model/Group.php:569 msgid "add" msgstr "" -#: src/Model/Group.php:512 +#: src/Model/Group.php:574 msgid "Edit group" msgstr "" -#: src/Model/Group.php:513 src/Module/Group.php:194 +#: src/Model/Group.php:575 src/Module/Group.php:194 msgid "Contacts not in any group" msgstr "" -#: src/Model/Group.php:515 +#: src/Model/Group.php:577 msgid "Create a new group" msgstr "" -#: src/Model/Group.php:516 src/Module/Group.php:179 src/Module/Group.php:202 +#: src/Model/Group.php:578 src/Module/Group.php:179 src/Module/Group.php:202 #: src/Module/Group.php:277 msgid "Group Name: " msgstr "" -#: src/Model/Group.php:517 +#: src/Model/Group.php:579 msgid "Edit groups" msgstr "" @@ -8596,6 +8576,11 @@ msgstr "" msgid "Visible to:" msgstr "" +#: src/Module/PermissionTooltip.php:174 +#, php-format +msgid "%d more" +msgstr "" + #: src/Module/PermissionTooltip.php:178 #, php-format msgid "To: %s
    " From e0ea51818e44c86d40a028ebef6e8d70569c3d0b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 20 Feb 2022 16:17:03 -0500 Subject: [PATCH 064/170] Add constructors to a couple of Mastodon API value objects --- src/Module/Api/Mastodon/Instance.php | 3 +- src/Object/Api/Mastodon/Instance.php | 58 ++++++++++++++-------------- src/Object/Api/Mastodon/Stats.php | 21 ++++------ 3 files changed, 39 insertions(+), 43 deletions(-) diff --git a/src/Module/Api/Mastodon/Instance.php b/src/Module/Api/Mastodon/Instance.php index 4115e0e6b..6d3db9018 100644 --- a/src/Module/Api/Mastodon/Instance.php +++ b/src/Module/Api/Mastodon/Instance.php @@ -22,6 +22,7 @@ namespace Friendica\Module\Api\Mastodon; use Friendica\Core\System; +use Friendica\DI; use Friendica\Module\BaseApi; use Friendica\Object\Api\Mastodon\Instance as InstanceEntity; @@ -35,6 +36,6 @@ class Instance extends BaseApi */ protected function rawContent(array $request = []) { - System::jsonExit(InstanceEntity::get()); + System::jsonExit(new InstanceEntity(DI::config(), $this->baseUrl, DI::dba())); } } diff --git a/src/Object/Api/Mastodon/Instance.php b/src/Object/Api/Mastodon/Instance.php index 70184c313..4337c3d1f 100644 --- a/src/Object/Api/Mastodon/Instance.php +++ b/src/Object/Api/Mastodon/Instance.php @@ -21,11 +21,15 @@ namespace Friendica\Object\Api\Mastodon; +use Friendica\App\BaseURL; use Friendica\BaseDataTransferObject; +use Friendica\Core\Config\Capability\IManageConfigValues; +use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\User; use Friendica\Module\Register; +use Friendica\Network\HTTPException; /** * Class Instance @@ -68,43 +72,39 @@ class Instance extends BaseDataTransferObject protected $rules = []; /** - * Creates an instance record - * - * @return Instance - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @param IManageConfigValues $config + * @param BaseURL $baseUrl + * @param Database $database + * @throws HTTPException\InternalServerErrorException + * @throws HTTPException\NotFoundException * @throws \ImagickException */ - public static function get() + public function __construct(IManageConfigValues $config, BaseURL $baseUrl, Database $database) { - $register_policy = intval(DI::config()->get('config', 'register_policy')); + $register_policy = intval($config->get('config', 'register_policy')); - $baseUrl = DI::baseUrl(); + $this->uri = $baseUrl->get(); + $this->title = $config->get('config', 'sitename'); + $this->short_description = $this->description = $config->get('config', 'info'); + $this->email = $config->get('config', 'admin_email'); + $this->version = FRIENDICA_VERSION; + $this->urls = null; // Not supported + $this->stats = new Stats($config, $database); + $this->thumbnail = $baseUrl->get() . ($config->get('system', 'shortcut_icon') ?? 'images/friendica-32.png'); + $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); + $this->approval_required = ($register_policy == Register::APPROVE); + $this->invites_enabled = false; + $this->contact_account = []; - $instance = new Instance(); - $instance->uri = $baseUrl->get(); - $instance->title = DI::config()->get('config', 'sitename'); - $instance->short_description = $instance->description = DI::config()->get('config', 'info'); - $instance->email = DI::config()->get('config', 'admin_email'); - $instance->version = FRIENDICA_VERSION; - $instance->urls = null; // Not supported - $instance->stats = Stats::get(); - $instance->thumbnail = $baseUrl->get() . (DI::config()->get('system', 'shortcut_icon') ?? 'images/friendica-32.png'); - $instance->languages = [DI::config()->get('system', 'language')]; - $instance->max_toot_chars = (int)DI::config()->get('config', 'api_import_size', DI::config()->get('config', 'max_import_size')); - $instance->registrations = ($register_policy != Register::CLOSED); - $instance->approval_required = ($register_policy == Register::APPROVE); - $instance->invites_enabled = false; - $instance->contact_account = []; - - if (!empty(DI::config()->get('config', 'admin_email'))) { - $adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email'))); + if (!empty($config->get('config', 'admin_email'))) { + $adminList = explode(',', str_replace(' ', '', $config->get('config', 'admin_email'))); $administrator = User::getByEmail($adminList[0], ['nickname']); if (!empty($administrator)) { - $adminContact = DBA::selectFirst('contact', ['id'], ['nick' => $administrator['nickname'], 'self' => true]); - $instance->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id']); + $adminContact = $database->selectFirst('contact', ['id'], ['nick' => $administrator['nickname'], 'self' => true]); + $this->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id']); } } - - return $instance; } } diff --git a/src/Object/Api/Mastodon/Stats.php b/src/Object/Api/Mastodon/Stats.php index 5061c5729..40a55c6d7 100644 --- a/src/Object/Api/Mastodon/Stats.php +++ b/src/Object/Api/Mastodon/Stats.php @@ -22,7 +22,9 @@ namespace Friendica\Object\Api\Mastodon; use Friendica\BaseDataTransferObject; +use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Protocol; +use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; @@ -40,19 +42,12 @@ class Stats extends BaseDataTransferObject /** @var int */ protected $domain_count = 0; - /** - * Creates a stats record - * - * @return Stats - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - */ - public static function get() { - $stats = new Stats(); - if (!empty(DI::config()->get('system', 'nodeinfo'))) { - $stats->user_count = intval(DI::config()->get('nodeinfo', 'total_users')); - $stats->status_count = DI::config()->get('nodeinfo', 'local_posts') + DI::config()->get('nodeinfo', 'local_comments'); - $stats->domain_count = DBA::count('gserver', ["`network` in (?, ?) AND NOT `failed`", Protocol::DFRN, Protocol::ACTIVITYPUB]); + public function __construct(IManageConfigValues $config, Database $database) + { + if (!empty($config->get('system', 'nodeinfo'))) { + $this->user_count = intval($config->get('nodeinfo', 'total_users')); + $this->status_count = $config->get('nodeinfo', 'local_posts') + $config->get('nodeinfo', 'local_comments'); + $this->domain_count = $database->count('gserver', ["`network` in (?, ?) AND NOT `failed`", Protocol::DFRN, Protocol::ACTIVITYPUB]); } - return $stats; } } From d7b573c6d76a9ac430134faa9936e806224df860 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 20 Feb 2022 16:19:22 -0500 Subject: [PATCH 065/170] Update Mastodon API version string to include Mastodon version compatibility --- src/Module/Api/Mastodon/Instance.php | 27 +++++++++++++++++++++++++-- src/Object/Api/Mastodon/Instance.php | 2 +- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/Module/Api/Mastodon/Instance.php b/src/Module/Api/Mastodon/Instance.php index 6d3db9018..e5e0a9579 100644 --- a/src/Module/Api/Mastodon/Instance.php +++ b/src/Module/Api/Mastodon/Instance.php @@ -21,21 +21,44 @@ namespace Friendica\Module\Api\Mastodon; +use Friendica\App; +use Friendica\Core\Config\Capability\IManageConfigValues; +use Friendica\Core\L10n; use Friendica\Core\System; -use Friendica\DI; +use Friendica\Database\Database; +use Friendica\Module\Api\ApiResponse; use Friendica\Module\BaseApi; use Friendica\Object\Api\Mastodon\Instance as InstanceEntity; +use Friendica\Util\Profiler; +use Psr\Log\LoggerInterface; /** * @see https://docs.joinmastodon.org/api/rest/instances/ */ class Instance extends BaseApi { + /** @var Database */ + private $database; + + /** @var IManageConfigValues */ + private $config; + + public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, Database $database, IManageConfigValues $config, array $server, array $parameters = []) + { + parent::__construct($app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); + + $this->database = $database; + $this->config = $config; + } + /** + * @param array $request * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \Friendica\Network\HTTPException\NotFoundException + * @throws \ImagickException */ protected function rawContent(array $request = []) { - System::jsonExit(new InstanceEntity(DI::config(), $this->baseUrl, DI::dba())); + System::jsonExit(new InstanceEntity($this->config, $this->baseUrl, $this->database)); } } diff --git a/src/Object/Api/Mastodon/Instance.php b/src/Object/Api/Mastodon/Instance.php index 4337c3d1f..0ae96c972 100644 --- a/src/Object/Api/Mastodon/Instance.php +++ b/src/Object/Api/Mastodon/Instance.php @@ -87,7 +87,7 @@ class Instance extends BaseDataTransferObject $this->title = $config->get('config', 'sitename'); $this->short_description = $this->description = $config->get('config', 'info'); $this->email = $config->get('config', 'admin_email'); - $this->version = FRIENDICA_VERSION; + $this->version = '2.8.0 (compatible; Friendica ' . FRIENDICA_VERSION . ')'; $this->urls = null; // Not supported $this->stats = new Stats($config, $database); $this->thumbnail = $baseUrl->get() . ($config->get('system', 'shortcut_icon') ?? 'images/friendica-32.png'); From ec0b05d8262b878bab1b756ae668b49f0d08f5ae Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 21 Feb 2022 05:17:54 +0000 Subject: [PATCH 066/170] Display announces identital for starting posts and comments --- src/Content/Conversation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index af96deebd..e441e8ba4 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -154,7 +154,7 @@ class Conversation // Skip when the causer of the parent is the same than the author of the announce if (($verb == Activity::ANNOUNCE) && Post::exists(['uri-id' => $activity['thr-parent-id'], - 'uid' => $activity['uid'], 'causer-id' => $activity['author-id'], 'gravity' => GRAVITY_PARENT])) { + 'uid' => $activity['uid'], 'causer-id' => $activity['author-id'], 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]])) { continue; } @@ -843,7 +843,7 @@ class Conversation $row['owner-name'] = $row['causer-name']; } - if (($row['gravity'] == GRAVITY_PARENT) && !empty($row['causer-id'])) { + if (in_array($row['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT]) && !empty($row['causer-id'])) { $causer = ['uid' => 0, 'id' => $row['causer-id'], 'network' => $row['causer-network'], 'url' => $row['causer-link']]; $row['reshared'] = $this->l10n->t('%s reshared this.', '
    ' . htmlentities($row['causer-name']) . ''); From 9bb7e4cdfe632873e7827f67033ce026f4710821 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 21 Feb 2022 06:37:13 +0100 Subject: [PATCH 067/170] DE translation updates --- view/lang/de/messages.po | 241 +++++++++++++++++++++------------------ view/lang/de/strings.php | 7 +- 2 files changed, 138 insertions(+), 110 deletions(-) diff --git a/view/lang/de/messages.po b/view/lang/de/messages.po index c7ce06c9a..aef3bcd5d 100644 --- a/view/lang/de/messages.po +++ b/view/lang/de/messages.po @@ -49,8 +49,8 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-19 13:54+0000\n" -"PO-Revision-Date: 2022-02-20 06:51+0000\n" +"POT-Creation-Date: 2022-02-20 20:50+0000\n" +"PO-Revision-Date: 2022-02-21 05:34+0000\n" "Last-Translator: Tobias Diekershoff \n" "Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" "MIME-Version: 1.0\n" @@ -204,7 +204,7 @@ msgid "Save" msgstr "Speichern" #: mod/editpost.php:92 mod/photos.php:1344 src/Content/Conversation.php:326 -#: src/Module/Contact/Poke.php:176 src/Object/Post.php:960 +#: src/Module/Contact/Poke.php:176 src/Object/Post.php:982 msgid "Loading..." msgstr "lädt..." @@ -270,7 +270,7 @@ msgstr "Ort löschen" #: mod/editpost.php:107 mod/message.php:200 mod/message.php:358 #: mod/photos.php:1495 mod/wallmessage.php:142 #: src/Content/Conversation.php:355 src/Content/Conversation.php:690 -#: src/Module/Item/Compose.php:165 src/Object/Post.php:498 +#: src/Module/Item/Compose.php:165 src/Object/Post.php:520 msgid "Please wait" msgstr "Bitte warten" @@ -302,7 +302,7 @@ msgstr "Z.B.: bob@example.com, mary@example.com" #: mod/editpost.php:128 mod/events.php:517 mod/photos.php:1343 #: mod/photos.php:1399 mod/photos.php:1473 src/Content/Conversation.php:370 -#: src/Module/Item/Compose.php:160 src/Object/Post.php:970 +#: src/Module/Item/Compose.php:160 src/Object/Post.php:992 msgid "Preview" msgstr "Vorschau" @@ -314,37 +314,37 @@ msgid "Cancel" msgstr "Abbrechen" #: mod/editpost.php:134 src/Content/Conversation.php:331 -#: src/Module/Item/Compose.php:151 src/Object/Post.php:961 +#: src/Module/Item/Compose.php:151 src/Object/Post.php:983 msgid "Bold" msgstr "Fett" #: mod/editpost.php:135 src/Content/Conversation.php:332 -#: src/Module/Item/Compose.php:152 src/Object/Post.php:962 +#: src/Module/Item/Compose.php:152 src/Object/Post.php:984 msgid "Italic" msgstr "Kursiv" #: mod/editpost.php:136 src/Content/Conversation.php:333 -#: src/Module/Item/Compose.php:153 src/Object/Post.php:963 +#: src/Module/Item/Compose.php:153 src/Object/Post.php:985 msgid "Underline" msgstr "Unterstrichen" #: mod/editpost.php:137 src/Content/Conversation.php:334 -#: src/Module/Item/Compose.php:154 src/Object/Post.php:964 +#: src/Module/Item/Compose.php:154 src/Object/Post.php:986 msgid "Quote" msgstr "Zitat" #: mod/editpost.php:138 src/Content/Conversation.php:335 -#: src/Module/Item/Compose.php:155 src/Object/Post.php:965 +#: src/Module/Item/Compose.php:155 src/Object/Post.php:987 msgid "Code" msgstr "Code" #: mod/editpost.php:139 src/Content/Conversation.php:337 -#: src/Module/Item/Compose.php:157 src/Object/Post.php:967 +#: src/Module/Item/Compose.php:157 src/Object/Post.php:989 msgid "Link" msgstr "Link" #: mod/editpost.php:140 src/Content/Conversation.php:338 -#: src/Module/Item/Compose.php:158 src/Object/Post.php:968 +#: src/Module/Item/Compose.php:158 src/Object/Post.php:990 msgid "Link or Media" msgstr "Link oder Mediendatei" @@ -452,7 +452,7 @@ msgstr "Veranstaltung teilen" #: src/Module/Install.php:252 src/Module/Install.php:294 #: src/Module/Install.php:331 src/Module/Invite.php:177 #: src/Module/Item/Compose.php:150 src/Module/Profile/Profile.php:247 -#: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:959 +#: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:981 #: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160 #: view/theme/quattro/config.php:71 view/theme/vier/config.php:119 msgid "Submit" @@ -1104,17 +1104,17 @@ msgstr "Drehen EUS (links)" #: mod/photos.php:1339 mod/photos.php:1395 mod/photos.php:1469 #: src/Module/Contact.php:544 src/Module/Item/Compose.php:148 -#: src/Object/Post.php:956 +#: src/Object/Post.php:978 msgid "This is you" msgstr "Das bist du" #: mod/photos.php:1341 mod/photos.php:1397 mod/photos.php:1471 -#: src/Object/Post.php:492 src/Object/Post.php:958 +#: src/Object/Post.php:514 src/Object/Post.php:980 msgid "Comment" msgstr "Kommentar" #: mod/photos.php:1430 src/Content/Conversation.php:615 -#: src/Object/Post.php:227 +#: src/Object/Post.php:247 msgid "Select" msgstr "Auswählen" @@ -1124,19 +1124,19 @@ msgstr "Auswählen" msgid "Delete" msgstr "Löschen" -#: mod/photos.php:1492 src/Object/Post.php:349 +#: mod/photos.php:1492 src/Object/Post.php:369 msgid "Like" msgstr "Mag ich" -#: mod/photos.php:1493 src/Object/Post.php:349 +#: mod/photos.php:1493 src/Object/Post.php:369 msgid "I like this (toggle)" msgstr "Ich mag das (toggle)" -#: mod/photos.php:1494 src/Object/Post.php:350 +#: mod/photos.php:1494 src/Object/Post.php:370 msgid "Dislike" msgstr "Mag ich nicht" -#: mod/photos.php:1496 src/Object/Post.php:350 +#: mod/photos.php:1496 src/Object/Post.php:370 msgid "I don't like this (toggle)" msgstr "Ich mag das nicht (toggle)" @@ -1506,7 +1506,7 @@ msgstr "In diesen Ordner verschieben:" msgid "Unable to find your profile. Please contact your admin." msgstr "Konnte dein Profil nicht finden. Bitte kontaktiere den Admin." -#: mod/settings.php:664 src/Content/Widget.php:526 +#: mod/settings.php:664 src/Content/Widget.php:523 msgid "Account Types" msgstr "Kontenarten" @@ -2198,8 +2198,8 @@ msgid "All contacts" msgstr "Alle Kontakte" #: src/BaseModule.php:409 src/Content/Widget.php:231 src/Core/ACL.php:193 -#: src/Module/Contact.php:367 src/Module/PermissionTooltip.php:98 -#: src/Module/PermissionTooltip.php:120 +#: src/Module/Contact.php:367 src/Module/PermissionTooltip.php:103 +#: src/Module/PermissionTooltip.php:125 msgid "Followers" msgstr "Folgende" @@ -2527,7 +2527,7 @@ msgid "Visible to everybody" msgstr "Für jedermann sichtbar" #: src/Content/Conversation.php:308 src/Module/Item/Compose.php:159 -#: src/Object/Post.php:969 +#: src/Object/Post.php:991 msgid "Please enter a image/video/audio/webpage URL:" msgstr "Bitte gib eine Bild/Video/Audio/Webseiten-URL ein:" @@ -2551,12 +2551,12 @@ msgstr "Einträge löschen?" msgid "New Post" msgstr "Neuer Beitrag" -#: src/Content/Conversation.php:325 src/Object/Post.php:475 +#: src/Content/Conversation.php:325 src/Object/Post.php:497 msgid "Share" msgstr "Teilen" #: src/Content/Conversation.php:336 src/Module/Item/Compose.php:156 -#: src/Object/Post.php:966 +#: src/Object/Post.php:988 msgid "Image" msgstr "Bild" @@ -2568,21 +2568,21 @@ msgstr "Video" msgid "Scheduled at" msgstr "Geplant für" -#: src/Content/Conversation.php:651 src/Object/Post.php:448 -#: src/Object/Post.php:449 +#: src/Content/Conversation.php:651 src/Object/Post.php:468 +#: src/Object/Post.php:469 #, php-format msgid "View %s's profile @ %s" msgstr "Das Profil von %s auf %s betrachten." -#: src/Content/Conversation.php:664 src/Object/Post.php:436 +#: src/Content/Conversation.php:664 src/Object/Post.php:456 msgid "Categories:" msgstr "Kategorien:" -#: src/Content/Conversation.php:665 src/Object/Post.php:437 +#: src/Content/Conversation.php:665 src/Object/Post.php:457 msgid "Filed under:" msgstr "Abgelegt unter:" -#: src/Content/Conversation.php:673 src/Object/Post.php:462 +#: src/Content/Conversation.php:673 src/Object/Post.php:482 #, php-format msgid "%s from %s" msgstr "%s von %s" @@ -2742,7 +2742,7 @@ msgid "Display membership date in profile" msgstr "Das Datum der Registrierung deines Accounts im Profil anzeigen" #: src/Content/ForumManager.php:145 src/Content/Nav.php:239 -#: src/Content/Text/HTML.php:896 src/Content/Widget.php:523 +#: src/Content/Text/HTML.php:896 src/Content/Widget.php:520 msgid "Forums" msgstr "Foren" @@ -2750,12 +2750,12 @@ msgstr "Foren" msgid "External link to forum" msgstr "Externer Link zum Forum" -#: src/Content/ForumManager.php:150 src/Content/Widget.php:502 +#: src/Content/ForumManager.php:150 src/Content/Widget.php:499 msgid "show less" msgstr "weniger anzeigen" -#: src/Content/ForumManager.php:151 src/Content/Widget.php:404 -#: src/Content/Widget.php:503 +#: src/Content/ForumManager.php:151 src/Content/Widget.php:401 +#: src/Content/Widget.php:500 msgid "show more" msgstr "mehr anzeigen" @@ -2815,7 +2815,7 @@ msgstr "Sperren" msgid "Ignore" msgstr "Ignorieren" -#: src/Content/Item.php:443 src/Object/Post.php:423 +#: src/Content/Item.php:443 src/Object/Post.php:443 msgid "Languages" msgstr "Sprachen" @@ -3213,7 +3213,7 @@ msgstr "Weltweites Verzeichnis" msgid "Local Directory" msgstr "Lokales Verzeichnis" -#: src/Content/Widget.php:207 src/Model/Group.php:508 +#: src/Content/Widget.php:207 src/Model/Group.php:570 #: src/Module/Contact.php:354 src/Module/Welcome.php:76 msgid "Groups" msgstr "Gruppen" @@ -3243,38 +3243,38 @@ msgstr "Alle Protokolle" msgid "Saved Folders" msgstr "Gespeicherte Ordner" -#: src/Content/Widget.php:311 src/Content/Widget.php:345 +#: src/Content/Widget.php:311 src/Content/Widget.php:342 msgid "Everything" msgstr "Alles" -#: src/Content/Widget.php:343 +#: src/Content/Widget.php:340 msgid "Categories" msgstr "Kategorien" -#: src/Content/Widget.php:400 +#: src/Content/Widget.php:397 #, php-format msgid "%d contact in common" msgid_plural "%d contacts in common" msgstr[0] "%d gemeinsamer Kontakt" msgstr[1] "%d gemeinsame Kontakte" -#: src/Content/Widget.php:496 +#: src/Content/Widget.php:493 msgid "Archives" msgstr "Archiv" -#: src/Content/Widget.php:520 +#: src/Content/Widget.php:517 msgid "Persons" msgstr "Personen" -#: src/Content/Widget.php:521 +#: src/Content/Widget.php:518 msgid "Organisations" msgstr "Organisationen" -#: src/Content/Widget.php:522 src/Model/Contact.php:1472 +#: src/Content/Widget.php:519 src/Model/Contact.php:1472 msgid "News" msgstr "Nachrichten" -#: src/Content/Widget.php:527 src/Module/Admin/BaseUsers.php:51 +#: src/Content/Widget.php:524 src/Module/Admin/BaseUsers.php:51 msgid "All" msgstr "Alle" @@ -3347,8 +3347,8 @@ msgstr "Entfolgen" msgid "Yourself" msgstr "Du selbst" -#: src/Core/ACL.php:200 src/Module/PermissionTooltip.php:104 -#: src/Module/PermissionTooltip.php:126 +#: src/Core/ACL.php:200 src/Module/PermissionTooltip.php:109 +#: src/Module/PermissionTooltip.php:131 msgid "Mutuals" msgstr "Beidseitige Freundschaft" @@ -4250,40 +4250,40 @@ msgid "" "not what you intended, please create another group with a different name." msgstr "Eine gelöschte Gruppe mit diesem Namen wurde wiederbelebt. Bestehende Berechtigungseinstellungen könnten auf diese Gruppe oder zukünftige Mitglieder angewandt werden. Falls du dies nicht möchtest, erstelle bitte eine andere Gruppe mit einem anderen Namen." -#: src/Model/Group.php:424 +#: src/Model/Group.php:486 msgid "Default privacy group for new contacts" msgstr "Voreingestellte Gruppe für neue Kontakte" -#: src/Model/Group.php:456 +#: src/Model/Group.php:518 msgid "Everybody" msgstr "Alle Kontakte" -#: src/Model/Group.php:475 +#: src/Model/Group.php:537 msgid "edit" msgstr "bearbeiten" -#: src/Model/Group.php:507 +#: src/Model/Group.php:569 msgid "add" msgstr "hinzufügen" -#: src/Model/Group.php:512 +#: src/Model/Group.php:574 msgid "Edit group" msgstr "Gruppe bearbeiten" -#: src/Model/Group.php:513 src/Module/Group.php:194 +#: src/Model/Group.php:575 src/Module/Group.php:194 msgid "Contacts not in any group" msgstr "Kontakte in keiner Gruppe" -#: src/Model/Group.php:515 +#: src/Model/Group.php:577 msgid "Create a new group" msgstr "Neue Gruppe erstellen" -#: src/Model/Group.php:516 src/Module/Group.php:179 src/Module/Group.php:202 +#: src/Model/Group.php:578 src/Module/Group.php:179 src/Module/Group.php:202 #: src/Module/Group.php:277 msgid "Group Name: " msgstr "Gruppenname:" -#: src/Model/Group.php:517 +#: src/Model/Group.php:579 msgid "Edit groups" msgstr "Gruppen bearbeiten" @@ -7133,7 +7133,7 @@ msgid "Only show blocked contacts" msgstr "Nur blockierte Kontakte anzeigen" #: src/Module/Contact.php:330 src/Module/Contact.php:377 -#: src/Object/Post.php:309 +#: src/Object/Post.php:329 msgid "Ignored" msgstr "Ignoriert" @@ -7685,7 +7685,7 @@ msgstr "Persönlich" msgid "Posts that mention or involve you" msgstr "Beiträge, in denen es um dich geht" -#: src/Module/Conversation/Network.php:277 src/Object/Post.php:321 +#: src/Module/Conversation/Network.php:277 src/Object/Post.php:341 msgid "Starred" msgstr "Markierte" @@ -8607,14 +8607,29 @@ msgstr "Falscher Typ \"%s\", hatte einen der Folgenden erwartet: %s" msgid "Model not found" msgstr "Model nicht gefunden" -#: src/Module/PermissionTooltip.php:83 +#: src/Module/PermissionTooltip.php:88 msgid "Remote privacy information not available." msgstr "Entfernte Privatsphäreneinstellungen nicht verfügbar." -#: src/Module/PermissionTooltip.php:92 +#: src/Module/PermissionTooltip.php:97 msgid "Visible to:" msgstr "Sichtbar für:" +#: src/Module/PermissionTooltip.php:174 +#, php-format +msgid "%d more" +msgstr "%d weitere" + +#: src/Module/PermissionTooltip.php:178 +#, php-format +msgid "To: %s
    " +msgstr "To: %s
    " + +#: src/Module/PermissionTooltip.php:181 +#, php-format +msgid "CC: %s
    " +msgstr "CC: %s
    " + #: src/Module/Photo.php:123 msgid "The Photo is not available." msgstr "Das Foto ist nicht verfügbar." @@ -10441,193 +10456,201 @@ msgstr "Falls du diese Beiträge nicht erhalten möchtest, kontaktiere bitte den msgid "%s posted an update." msgstr "%s hat ein Update veröffentlicht." -#: src/Object/Post.php:147 -msgid "This entry was edited" -msgstr "Dieser Beitrag wurde bearbeitet." - -#: src/Object/Post.php:175 +#: src/Object/Post.php:134 msgid "Private Message" msgstr "Private Nachricht" -#: src/Object/Post.php:178 +#: src/Object/Post.php:137 +msgid "Public Message" +msgstr "Öffentlicher Beitrag" + +#: src/Object/Post.php:140 +msgid "Unlisted Message" +msgstr "Nicht gelisteter Beitrag" + +#: src/Object/Post.php:170 +msgid "This entry was edited" +msgstr "Dieser Beitrag wurde bearbeitet." + +#: src/Object/Post.php:198 msgid "Connector Message" msgstr "Connector Nachricht" -#: src/Object/Post.php:193 src/Object/Post.php:195 +#: src/Object/Post.php:213 src/Object/Post.php:215 msgid "Edit" msgstr "Bearbeiten" -#: src/Object/Post.php:215 +#: src/Object/Post.php:235 msgid "Pinned item" msgstr "Angehefteter Beitrag" -#: src/Object/Post.php:219 +#: src/Object/Post.php:239 msgid "Delete globally" msgstr "Global löschen" -#: src/Object/Post.php:219 +#: src/Object/Post.php:239 msgid "Remove locally" msgstr "Lokal entfernen" -#: src/Object/Post.php:235 +#: src/Object/Post.php:255 #, php-format msgid "Block %s" msgstr "Blockiere %s" -#: src/Object/Post.php:240 +#: src/Object/Post.php:260 msgid "Save to folder" msgstr "In Ordner speichern" -#: src/Object/Post.php:274 +#: src/Object/Post.php:294 msgid "I will attend" msgstr "Ich werde teilnehmen" -#: src/Object/Post.php:274 +#: src/Object/Post.php:294 msgid "I will not attend" msgstr "Ich werde nicht teilnehmen" -#: src/Object/Post.php:274 +#: src/Object/Post.php:294 msgid "I might attend" msgstr "Ich werde eventuell teilnehmen" -#: src/Object/Post.php:304 +#: src/Object/Post.php:324 msgid "Ignore thread" msgstr "Thread ignorieren" -#: src/Object/Post.php:305 +#: src/Object/Post.php:325 msgid "Unignore thread" msgstr "Thread nicht mehr ignorieren" -#: src/Object/Post.php:306 +#: src/Object/Post.php:326 msgid "Toggle ignore status" msgstr "Ignoriert-Status ein-/ausschalten" -#: src/Object/Post.php:316 +#: src/Object/Post.php:336 msgid "Add star" msgstr "Markieren" -#: src/Object/Post.php:317 +#: src/Object/Post.php:337 msgid "Remove star" msgstr "Markierung entfernen" -#: src/Object/Post.php:318 +#: src/Object/Post.php:338 msgid "Toggle star status" msgstr "Markierung umschalten" -#: src/Object/Post.php:329 +#: src/Object/Post.php:349 msgid "Pin" msgstr "Anheften" -#: src/Object/Post.php:330 +#: src/Object/Post.php:350 msgid "Unpin" msgstr "Losmachen" -#: src/Object/Post.php:331 +#: src/Object/Post.php:351 msgid "Toggle pin status" msgstr "Angeheftet Status ändern" -#: src/Object/Post.php:334 +#: src/Object/Post.php:354 msgid "Pinned" msgstr "Angeheftet" -#: src/Object/Post.php:339 +#: src/Object/Post.php:359 msgid "Add tag" msgstr "Tag hinzufügen" -#: src/Object/Post.php:352 +#: src/Object/Post.php:372 msgid "Quote share this" msgstr "Teile und zitiere dies" -#: src/Object/Post.php:352 +#: src/Object/Post.php:372 msgid "Quote Share" msgstr "Zitat teilen" -#: src/Object/Post.php:355 +#: src/Object/Post.php:375 msgid "Reshare this" msgstr "Teile dies" -#: src/Object/Post.php:355 +#: src/Object/Post.php:375 msgid "Reshare" msgstr "Teilen" -#: src/Object/Post.php:356 +#: src/Object/Post.php:376 msgid "Cancel your Reshare" msgstr "Teilen aufheben" -#: src/Object/Post.php:356 +#: src/Object/Post.php:376 msgid "Unshare" msgstr "Nicht mehr teilen" -#: src/Object/Post.php:401 +#: src/Object/Post.php:421 #, php-format msgid "%s (Received %s)" msgstr "%s (Empfangen %s)" -#: src/Object/Post.php:406 +#: src/Object/Post.php:426 msgid "Comment this item on your system" msgstr "Kommentiere diesen Beitrag von deinem System aus" -#: src/Object/Post.php:406 +#: src/Object/Post.php:426 msgid "Remote comment" msgstr "Entfernter Kommentar" -#: src/Object/Post.php:450 +#: src/Object/Post.php:470 msgid "to" msgstr "zu" -#: src/Object/Post.php:451 +#: src/Object/Post.php:471 msgid "via" msgstr "via" -#: src/Object/Post.php:452 +#: src/Object/Post.php:472 msgid "Wall-to-Wall" msgstr "Wall-to-Wall" -#: src/Object/Post.php:453 +#: src/Object/Post.php:473 msgid "via Wall-To-Wall:" msgstr "via Wall-To-Wall:" -#: src/Object/Post.php:493 +#: src/Object/Post.php:515 #, php-format msgid "Reply to %s" msgstr "Antworte %s" -#: src/Object/Post.php:496 +#: src/Object/Post.php:518 msgid "More" msgstr "Mehr" -#: src/Object/Post.php:514 +#: src/Object/Post.php:536 msgid "Notifier task is pending" msgstr "Die Benachrichtigungsaufgabe ist ausstehend" -#: src/Object/Post.php:515 +#: src/Object/Post.php:537 msgid "Delivery to remote servers is pending" msgstr "Die Auslieferung an Remote-Server steht noch aus" -#: src/Object/Post.php:516 +#: src/Object/Post.php:538 msgid "Delivery to remote servers is underway" msgstr "Die Auslieferung an Remote-Server ist unterwegs" -#: src/Object/Post.php:517 +#: src/Object/Post.php:539 msgid "Delivery to remote servers is mostly done" msgstr "Die Zustellung an Remote-Server ist fast erledigt" -#: src/Object/Post.php:518 +#: src/Object/Post.php:540 msgid "Delivery to remote servers is done" msgstr "Die Zustellung an die Remote-Server ist erledigt" -#: src/Object/Post.php:538 +#: src/Object/Post.php:560 #, php-format msgid "%d comment" msgid_plural "%d comments" msgstr[0] "%d Kommentar" msgstr[1] "%d Kommentare" -#: src/Object/Post.php:539 +#: src/Object/Post.php:561 msgid "Show more" msgstr "Zeige mehr" -#: src/Object/Post.php:540 +#: src/Object/Post.php:562 msgid "Show fewer" msgstr "Zeige weniger" diff --git a/view/lang/de/strings.php b/view/lang/de/strings.php index 9e480c20f..d79645b59 100644 --- a/view/lang/de/strings.php +++ b/view/lang/de/strings.php @@ -2131,6 +2131,9 @@ $a->strings['Wrong type "%s", expected one of: %s'] = 'Falscher Typ "%s", hatte $a->strings['Model not found'] = 'Model nicht gefunden'; $a->strings['Remote privacy information not available.'] = 'Entfernte Privatsphäreneinstellungen nicht verfügbar.'; $a->strings['Visible to:'] = 'Sichtbar für:'; +$a->strings['%d more'] = '%d weitere'; +$a->strings['To: %s
    '] = 'To: %s
    '; +$a->strings['CC: %s
    '] = 'CC: %s
    '; $a->strings['The Photo is not available.'] = 'Das Foto ist nicht verfügbar.'; $a->strings['The Photo with id %s is not available.'] = 'Das Bild mit ID %s ist nicht verfügbar.'; $a->strings['Invalid external resource with url %s.'] = 'Ungültige externe Ressource mit der URL %s'; @@ -2557,8 +2560,10 @@ $a->strings['This message was sent to you by %s, a member of the Friendica socia $a->strings['You may visit them online at %s'] = 'Du kannst sie online unter %s besuchen'; $a->strings['Please contact the sender by replying to this post if you do not wish to receive these messages.'] = 'Falls du diese Beiträge nicht erhalten möchtest, kontaktiere bitte den Autor, indem du auf diese Nachricht antwortest.'; $a->strings['%s posted an update.'] = '%s hat ein Update veröffentlicht.'; -$a->strings['This entry was edited'] = 'Dieser Beitrag wurde bearbeitet.'; $a->strings['Private Message'] = 'Private Nachricht'; +$a->strings['Public Message'] = 'Öffentlicher Beitrag'; +$a->strings['Unlisted Message'] = 'Nicht gelisteter Beitrag'; +$a->strings['This entry was edited'] = 'Dieser Beitrag wurde bearbeitet.'; $a->strings['Connector Message'] = 'Connector Nachricht'; $a->strings['Edit'] = 'Bearbeiten'; $a->strings['Pinned item'] = 'Angehefteter Beitrag'; From b0ab82355b0c21407e756f91a3aa44ae4a7a0492 Mon Sep 17 00:00:00 2001 From: bkil Date: Wed, 23 Feb 2022 15:05:24 +0100 Subject: [PATCH 068/170] doc/Install.md: Troubleshooting: loadavg, filesystem ACL, big uploads --- doc/Install.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/doc/Install.md b/doc/Install.md index 47f4f9e78..61c102e98 100644 --- a/doc/Install.md +++ b/doc/Install.md @@ -449,3 +449,58 @@ section: sql_mode = ''; After that, restart mysql and try again. + +### Your worker never or rarely runs + +Friendica is coded to always play nice. It checks whether the host machine is idle enough and if it _seems_ to be overloaded, it intermittently refuses to process the worker queue. + +Such checks originate from the days of single-user single-core machines and involves thresholds that you should adjust based on the number of exclusive CPU cores you have. See this issue for more information: + +* https://github.com/friendica/friendica/issues/10131 + +If you want to be neighborly and are using a shared web hosting PaaS provider, especially within the free tier, you need to set `maxloadavg` to say twice the maximum value of `/proc/loadavg` during peak hours. + +If you have the whole (virtual) machine for yourself such as in case of an IaaS VPS, you can set it to orders of magnitude higher than its commonly observed value, such as 1000. + +You should instead enact limits in your web server configuration based on the number of entry processes to cap the concurrent memory usage of your PHP processes. +See `RLimitMEM`, `RLimitCPU`, `RLimitNPROC`, `StartServers`, `ServerLimit`, `MaxRequestsPerChild`, `pm.max_children`, `pm.start_servers` and related options in your server. + +### Error uploading even small image files + +You tried to upload an image up to 100kB and it failed. + +You may not have the ownership or file mode set correctly if you are using the file system storage backend. + +Change the backend to database. If this solves it, that that is was needs to be fixed. + +### Error uploading large files + +You may find `413 Request Entity Too Large` or `500 Internal Error` in the network inspector of the browser if the file is too large, for example if it is a video. + +First try to upload a very small file, up to 100kB. If that succeeds, you will need to increase limits at multiple places, including on any web proxy that you are using. + +In your PHP ini: + +* `upload_max_filesize`: defaults to 2MB +* `post_max_size`: defaults to 8MB, must be greater than `upload_max_filesize` +* `memory_limit`: defaults to 128MB, must be greater than `post_max_size` + +You should verify whether you changed them in the _right file_ by checking the web interface at the end of the overview on the `Admin` panel. + +For Apache2: + +* `LimitRequestBody`: defaults to unlimited +* `SSLRenegBufferSize`: defaults to 128kB, only if your site uses TLS and perhaps only when using `SSLVerifyClient` or `SSLVerifyDepth` + +For nginx: + +* `client_max_body_size`: defaults to 1MB + +If you are using the database backend for storage, increase this in your SQL configuration: + +* `max_allowed_packet`: defaults to 32MB + +If you use the ModSecurity WAF: + +* `SecRequestBodyLimit`: defaults to 12MB +* `SecRequestBodyNoFilesLimit`: defaults to 128kB, should not apply to Friendica From dac67baf1104c5ebc11e45b560efb4b2fd69a0c9 Mon Sep 17 00:00:00 2001 From: bkil Date: Wed, 23 Feb 2022 15:20:15 +0100 Subject: [PATCH 069/170] doc/Install.md: fix typo within ACL section --- doc/Install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Install.md b/doc/Install.md index 61c102e98..8bbfdd99c 100644 --- a/doc/Install.md +++ b/doc/Install.md @@ -471,7 +471,7 @@ You tried to upload an image up to 100kB and it failed. You may not have the ownership or file mode set correctly if you are using the file system storage backend. -Change the backend to database. If this solves it, that that is was needs to be fixed. +Change the backend to database. If this solves it, that is what needs to be fixed. ### Error uploading large files From 59630a2c821cda6ac3a5ced81f2fb8831f8755f4 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 23 Feb 2022 20:18:37 +0000 Subject: [PATCH 070/170] Improve the name of the "followers" receiver --- src/Module/PermissionTooltip.php | 12 ++++++++++- src/Protocol/ActivityPub/Receiver.php | 2 +- view/lang/C/messages.po | 31 ++++++++++++++++----------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/Module/PermissionTooltip.php b/src/Module/PermissionTooltip.php index f6722c984..372c508d6 100644 --- a/src/Module/PermissionTooltip.php +++ b/src/Module/PermissionTooltip.php @@ -28,6 +28,7 @@ use Friendica\Model\Group; use Friendica\Model\Post; use Friendica\Model\Tag; use Friendica\Network\HTTPException; +use Friendica\Protocol\ActivityPub; /** * Outputs the permission tooltip HTML content for the provided item, photo or event id. @@ -161,7 +162,16 @@ class PermissionTooltip extends \Friendica\BaseModule // We only fetch "to" and "cc", because "bcc" should never be displayed $receivers = []; foreach (Tag::getByURIId($uriId, [Tag::TO, Tag::CC]) as $receiver) { - $receivers[$receiver['type']][] = $receiver['name']; + if ($receiver['url'] == ActivityPub::PUBLIC_COLLECTION) { + $receivers[$receiver['type']][] = DI::l10n()->t('Public'); + } else { + $apcontact = DBA::selectFirst('apcontact', ['name'], ['followers' => $receiver['url']]); + if (!empty($apcontact['name'])) { + $receivers[$receiver['type']][] = DI::l10n()->t('Followers (%s)', $apcontact['name']); + } else { + $receivers[$receiver['type']][] = $receiver['name']; + } + } } $output = ''; diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index e82745b75..32994a9d5 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -415,7 +415,7 @@ class Receiver } foreach (['as:to', 'as:cc', 'as:bto', 'as:bcc'] as $element) { - if (!empty($urls[$element])) { + if ((empty($object_data['receiver_urls'][$element]) || in_array($element, ['as:bto', 'as:bcc'])) && !empty($urls[$element])) { $object_data['receiver_urls'][$element] = array_unique(array_merge($object_data['receiver_urls'][$element] ?? [], $urls[$element])); } } diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 93b3f3731..ea72ffd87 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.05-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-20 20:50+0000\n" +"POT-Creation-Date: 2022-02-23 20:09+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2157,8 +2157,8 @@ msgid "All contacts" msgstr "" #: src/BaseModule.php:409 src/Content/Widget.php:231 src/Core/ACL.php:193 -#: src/Module/Contact.php:367 src/Module/PermissionTooltip.php:103 -#: src/Module/PermissionTooltip.php:125 +#: src/Module/Contact.php:367 src/Module/PermissionTooltip.php:104 +#: src/Module/PermissionTooltip.php:126 msgid "Followers" msgstr "" @@ -3305,8 +3305,8 @@ msgstr "" msgid "Yourself" msgstr "" -#: src/Core/ACL.php:200 src/Module/PermissionTooltip.php:109 -#: src/Module/PermissionTooltip.php:131 +#: src/Core/ACL.php:200 src/Module/PermissionTooltip.php:110 +#: src/Module/PermissionTooltip.php:132 msgid "Mutuals" msgstr "" @@ -3314,7 +3314,7 @@ msgstr "" msgid "Post to Email" msgstr "" -#: src/Core/ACL.php:319 +#: src/Core/ACL.php:319 src/Module/PermissionTooltip.php:166 msgid "Public" msgstr "" @@ -8559,34 +8559,39 @@ msgstr "" msgid "Unsupported or missing grant type" msgstr "" -#: src/Module/PermissionTooltip.php:44 +#: src/Module/PermissionTooltip.php:45 #, php-format msgid "Wrong type \"%s\", expected one of: %s" msgstr "" -#: src/Module/PermissionTooltip.php:61 +#: src/Module/PermissionTooltip.php:62 msgid "Model not found" msgstr "" -#: src/Module/PermissionTooltip.php:88 +#: src/Module/PermissionTooltip.php:89 msgid "Remote privacy information not available." msgstr "" -#: src/Module/PermissionTooltip.php:97 +#: src/Module/PermissionTooltip.php:98 msgid "Visible to:" msgstr "" -#: src/Module/PermissionTooltip.php:174 +#: src/Module/PermissionTooltip.php:170 +#, php-format +msgid "Followers (%s)" +msgstr "" + +#: src/Module/PermissionTooltip.php:184 #, php-format msgid "%d more" msgstr "" -#: src/Module/PermissionTooltip.php:178 +#: src/Module/PermissionTooltip.php:188 #, php-format msgid "To: %s
    " msgstr "" -#: src/Module/PermissionTooltip.php:181 +#: src/Module/PermissionTooltip.php:191 #, php-format msgid "CC: %s
    " msgstr "" From b24fe917e4aba4beb9618b85eab29af733e89ba5 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 22 Feb 2022 10:09:54 -0500 Subject: [PATCH 071/170] Prevent tagsinput select element to be submitted without a value when they are required - This was allowing to submit private messages to the wrong recipient --- view/js/friendica-tagsinput/friendica-tagsinput.js | 7 +------ view/templates/acl/message_recipient.tpl | 4 +++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/view/js/friendica-tagsinput/friendica-tagsinput.js b/view/js/friendica-tagsinput/friendica-tagsinput.js index e3db53df4..45c00641f 100644 --- a/view/js/friendica-tagsinput/friendica-tagsinput.js +++ b/view/js/friendica-tagsinput/friendica-tagsinput.js @@ -165,7 +165,7 @@ // add
    @@ -33,7 +33,7 @@