From 94cd729ccacd47d854ec4b447b9154edfa10491c Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 21 Sep 2022 09:46:24 +0200 Subject: [PATCH 01/12] Updates for the CHANGELOG for 2022.09 --- CHANGELOG | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 79301e6dd9..9b9441c8a6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,10 +1,41 @@ Version 2022.09 (unreleased) Friendica Core + Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN + Added a check for too long passwords (due Blowfish hashing algorithm) [MrPetovan] + Added the possibility to store profile avatars in a separate directory [annando] + Added an option to not fetch parent postings [annando] + Added an option to reject postings by language received by the relay [annando] + Added a notification mail to all users when the server block list is updated [MrPetovan] + Added a download link to the CSV file of the server block list on the about page [MrPetovan] + Updates to the themes (frio, smoothly) [AlessandroLorenzi, HankG, MrPetovan, tobiasd] + General code cleanup [annando, fabrixxm, Quix0r, tobiasd] + Enhanced the performance (cache, database, rendering) [annando, Quix0r] + Enhanced the language detection [annando] + Enhanced the display of the reason why a posting is shown to a user [annando] + Enhanced the fetching of missing postings [annando] + Enhanced the server detection [annando] + Enhanced the UI for 2FA logins [nupplaphil] + Enhanced the Woodpecker integration [nupplaphil] + Enhanced integration with ejabberd [nupplaphil] + Fixed a federation problem with Diaspora* during the author signature check [annando] + Fixed a problem with Forwarded-For headers [nupplaphil] + Fixed a problem with the encoding of mails send [MrPetovan] + Updated dependencies [MrPetovan] + Replace SFTP-publish with docker-publish [nupplaphil] + Removed the poke functionality [MrPetovan] Friendica Addons + Added GD translation, updates to the translation AR, FR + Removed the addons: morechoice, morepokes + Marked the addon whindowsphonepush as unsupported + twitter: + Valid post body can be empty [MrPetovan] Closed Issues - + 11177, 11317, 11458, 11566, 11625, 11635, 11636, 11638, 11651, 11661, + 11666, 11695, 11700, 11704, 11706, 11708, 11712, 11716, 11723, 11724, + 11726, 11731, 11732, 11751, 11765, 11775, 11779, 11794, 11798, 11799, + 11824, 11826, 11861, 11870 Version 2022.06 (2022-06-11) Friendica Core From b56a9cf4194280830a1654fd6403a294cbabd559 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 9 Oct 2022 16:01:02 +0200 Subject: [PATCH 02/12] some updates for the CHANGELOG --- CHANGELOG | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9b9441c8a6..d1ac37e9d0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ Version 2022.09 (unreleased) Added an option to reject postings by language received by the relay [annando] Added a notification mail to all users when the server block list is updated [MrPetovan] Added a download link to the CSV file of the server block list on the about page [MrPetovan] + Added support for youtube short URLs [annando] Updates to the themes (frio, smoothly) [AlessandroLorenzi, HankG, MrPetovan, tobiasd] General code cleanup [annando, fabrixxm, Quix0r, tobiasd] Enhanced the performance (cache, database, rendering) [annando, Quix0r] @@ -20,6 +21,8 @@ Version 2022.09 (unreleased) Fixed a federation problem with Diaspora* during the author signature check [annando] Fixed a problem with Forwarded-For headers [nupplaphil] Fixed a problem with the encoding of mails send [MrPetovan] + Fixed a problem with wired formatted date notations [annando, MrPetovan] + Fixed a problem following some RSS feeds [mexon] Updated dependencies [MrPetovan] Replace SFTP-publish with docker-publish [nupplaphil] Removed the poke functionality [MrPetovan] @@ -30,12 +33,14 @@ Version 2022.09 (unreleased) Marked the addon whindowsphonepush as unsupported twitter: Valid post body can be empty [MrPetovan] + Support of Twitter threads was added [annando] Closed Issues - 11177, 11317, 11458, 11566, 11625, 11635, 11636, 11638, 11651, 11661, - 11666, 11695, 11700, 11704, 11706, 11708, 11712, 11716, 11723, 11724, - 11726, 11731, 11732, 11751, 11765, 11775, 11779, 11794, 11798, 11799, - 11824, 11826, 11861, 11870 + 11177, 11317, 11458, 11471, 11566, 11614, 11625, 11635, 11636, 11638, + 11651, 11661, 11666, 11695, 11700, 11704, 11706, 11708, 11712, 11716, + 11722, 11723, 11724, 11726, 11731, 11732, 11751, 11765, 11775, 11778, + 11779, 11794, 11798, 11799, 11800, 11824, 11826, 11851, 11861, 11870, + 11909, 11920, 11931, 11938, 11943, 11952, 11953, 11969, 11975 Version 2022.06 (2022-06-11) Friendica Core From 656e74605fe34651245c35bae6414eb316d45a65 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 10 Oct 2022 07:36:43 +0200 Subject: [PATCH 03/12] typo --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d1ac37e9d0..d1320ddd83 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,7 +21,7 @@ Version 2022.09 (unreleased) Fixed a federation problem with Diaspora* during the author signature check [annando] Fixed a problem with Forwarded-For headers [nupplaphil] Fixed a problem with the encoding of mails send [MrPetovan] - Fixed a problem with wired formatted date notations [annando, MrPetovan] + Fixed a problem with weird formatted date notations [annando, MrPetovan] Fixed a problem following some RSS feeds [mexon] Updated dependencies [MrPetovan] Replace SFTP-publish with docker-publish [nupplaphil] From 7e8c48a5394d105ff3851fb54c484c9f0fee41b6 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 10 Oct 2022 07:57:12 +0200 Subject: [PATCH 04/12] added new API endpoint for events to the CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index d1320ddd83..ec188fd709 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Version 2022.09 (unreleased) Friendica Core Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN Added a check for too long passwords (due Blowfish hashing algorithm) [MrPetovan] + Added an API endpoint to create events [MrPetovan, pankraz] Added the possibility to store profile avatars in a separate directory [annando] Added an option to not fetch parent postings [annando] Added an option to reject postings by language received by the relay [annando] From 9e74a1bd0670e05322118e881a5915f778d7835c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 11 Oct 2022 08:26:00 -0400 Subject: [PATCH 05/12] Contact array can be empty in Model\Contact::getAvatarPath - Address https://github.com/friendica/friendica/issues/11630#issuecomment-1274195844 --- src/Model/Contact.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 2b6cb05bbf..ceaf635df1 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1680,11 +1680,9 @@ class Contact /** * Return the photo path for a given contact array in the given size * - * @param array $contact contact array - * @param string $field Fieldname of the photo in the contact array + * @param array $contact contact array * @param string $size Size of the avatar picture - * @param string $avatar Avatar path that is displayed when no photo had been found - * @param bool $no_update Don't perfom an update if no cached avatar was found + * @param bool $no_update Don't perfom an update if no cached avatar was found * @return string photo path */ private static function getAvatarPath(array $contact, string $size, bool $no_update = false): string @@ -1711,7 +1709,7 @@ class Contact } } - return self::getAvatarUrlForId($contact['id'], $size, $contact['updated'] ?? ''); + return self::getAvatarUrlForId($contact['id'] ?? 0, $size, $contact['updated'] ?? ''); } /** From 68d6e11d831cc3092e7011b90be36fa28fd0cbab Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Oct 2022 20:10:39 +0000 Subject: [PATCH 06/12] Fix attached media in quoted posts --- src/Content/Item.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Content/Item.php b/src/Content/Item.php index 539814655f..7a86135f9f 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -666,8 +666,19 @@ class Item $shared_content .= '[h3]' . $item['title'] . "[/h3]\n"; } + $shared = BBCode::fetchShareAttributes($item['body']); + + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); + // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { + if (!empty($shared['guid'])) { + $encaspulated_share = self::createSharedPostByGuid($shared['guid']); + if (!empty($encaspulated_share)) { + $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); + } + } + $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB)); } From f1f13db24fbeb9caa8d16bf4cdc858d7a3455456 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Oct 2022 20:48:47 +0000 Subject: [PATCH 07/12] Simplified code --- src/Content/Item.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 7a86135f9f..1b07c5585c 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -672,11 +672,8 @@ class Item // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { - if (!empty($shared['guid'])) { - $encaspulated_share = self::createSharedPostByGuid($shared['guid']); - if (!empty($encaspulated_share)) { - $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); - } + if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) { + $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); } $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB)); From 0e82f64d71b598a1349ac22973148715f7182fdd Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Oct 2022 21:39:28 +0000 Subject: [PATCH 08/12] Only attach images --- src/Content/Item.php | 2 +- src/Model/Post/Media.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 1b07c5585c..d1cdbc679b 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -668,7 +668,7 @@ class Item $shared = BBCode::fetchShareAttributes($item['body']); - $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body'], [Post\Media::IMAGE]); // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index 8fb10ddd88..ce00b205c5 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -648,11 +648,13 @@ class Media /** * Add media attachments to the body * - * @param int $uriid + * @param int $uriid * @param string $body + * @param array $types + * * @return string body */ - public static function addAttachmentsToBody(int $uriid, string $body = ''): string + public static function addAttachmentsToBody(int $uriid, string $body = '', array $types = [self::IMAGE, self::AUDIO, self::VIDEO]): string { if (empty($body)) { $item = Post::selectFirst(['body'], ['uri-id' => $uriid]); @@ -665,7 +667,7 @@ class Media $body = preg_replace("/\s*\[attachment .*?\].*?\[\/attachment\]\s*/ism", '', $body); - foreach (self::getByURIId($uriid, [self::IMAGE, self::AUDIO, self::VIDEO]) as $media) { + foreach (self::getByURIId($uriid, $types) as $media) { if (Item::containsLink($body, $media['preview'] ?? $media['url'], $media['type'])) { continue; } From 0480d9aebdeb13ab5517714406342d58e4d4298c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 11 Oct 2022 22:08:54 -0400 Subject: [PATCH 09/12] Add missing post keys to retrieve pLink in Model\Event::prepareListForTemplate() - Address https://github.com/friendica/friendica/issues/11632#issuecomment-1275117722 --- src/Model/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Event.php b/src/Model/Event.php index 712e5861ac..db66a330f9 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -580,7 +580,7 @@ class Event $last_date = ''; $fmt = DI::l10n()->t('l, F j'); foreach ($event_result as $event) { - $item = Post::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link', 'private', 'uri-id'], ['id' => $event['itemid']]); + $item = Post::selectFirst(['plink', 'author-name', 'author-network', 'author-id', 'author-avatar', 'author-link', 'private', 'uri-id'], ['id' => $event['itemid']]); if (!DBA::isResult($item)) { // Using default values when no item had been found $item = ['plink' => '', 'author-name' => '', 'author-avatar' => '', 'author-link' => '', 'private' => Item::PUBLIC, 'uri-id' => ($event['uri-id'] ?? 0)]; From e69b04d2df9726cd43a7c801febe8e4f7668f790 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 12 Oct 2022 05:34:55 +0000 Subject: [PATCH 10/12] Only add the media for non federated posts --- src/Content/Item.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index d1cdbc679b..1bf8410cd4 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -657,7 +657,9 @@ class Item public function createSharedBlockByArray(array $item): string { if (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { + $item['guid'] = ''; $item['uri'] = ''; + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); } $shared_content = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid'], $item['uri']); @@ -668,8 +670,6 @@ class Item $shared = BBCode::fetchShareAttributes($item['body']); - $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body'], [Post\Media::IMAGE]); - // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) { From 8936ae26fd50d0ef007e6efafec589e324fe65aa Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 13 Oct 2022 09:53:58 +0200 Subject: [PATCH 11/12] added fix for quoted shares from Twitter to the CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index ec188fd709..e3db699d87 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,7 @@ Version 2022.09 (unreleased) Fixed a problem with the encoding of mails send [MrPetovan] Fixed a problem with weird formatted date notations [annando, MrPetovan] Fixed a problem following some RSS feeds [mexon] + Fixed a problem with quoted reshares from Twitter [annando] Updated dependencies [MrPetovan] Replace SFTP-publish with docker-publish [nupplaphil] Removed the poke functionality [MrPetovan] From c2e57c5c0ee9f2f289b5d228afe876b4bcf6db1f Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 14 Oct 2022 04:43:46 +0000 Subject: [PATCH 12/12] Return the pageinfo when feed is shared --- src/Content/Item.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 1bf8410cd4..6cbcb63695 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -656,7 +656,9 @@ class Item */ public function createSharedBlockByArray(array $item): string { - if (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { + if ($item['network'] == Protocol::FEED) { + return PageInfo::getFooterFromUrl($item['plink']); + } elseif (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { $item['guid'] = ''; $item['uri'] = ''; $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); @@ -675,7 +677,7 @@ class Item if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) { $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); } - + $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB)); }