From 59088161e8f6df2ca36c08e40c44b21871afb3e9 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Tue, 6 Dec 2022 14:34:03 +0100 Subject: [PATCH 1/5] bump version to 2022.12-rc --- VERSION | 2 +- database.sql | 2 +- src/App.php | 2 +- view/lang/C/messages.po | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 151845e80..0be738a65 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2022.12-dev +2022.12-rc diff --git a/database.sql b/database.sql index 3169bac03..855c91358 100644 --- a/database.sql +++ b/database.sql @@ -1,5 +1,5 @@ -- ------------------------------------------ --- Friendica 2022.12-dev (Giant Rhubarb) +-- Friendica 2022.12-rc (Giant Rhubarb) -- DB_UPDATE_VERSION 1500 -- ------------------------------------------ diff --git a/src/App.php b/src/App.php index 623a5b63a..25770dd78 100644 --- a/src/App.php +++ b/src/App.php @@ -62,7 +62,7 @@ class App { const PLATFORM = 'Friendica'; const CODENAME = 'Giant Rhubarb'; - const VERSION = '2022.12-dev'; + const VERSION = '2022.12-rc'; // Allow themes to control internal parameters // by changing App values in theme.php diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 294256fd9..c8b295fe6 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 2022.12-dev\n" +"Project-Id-Version: 2022.12-rc\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-04 06:41-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" From 5e40b47a17e41e4e52c4264f231308cab25cdece Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 6 Dec 2022 17:45:18 +0000 Subject: [PATCH 2/5] Fix post completion --- src/Protocol/ActivityPub/Processor.php | 6 +++--- src/Protocol/Relay.php | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 3f61fe8f1..8e21a6644 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -957,7 +957,7 @@ class Processor } $tags = array_column(Tag::getByURIId($item['uri-id'], [Tag::HASHTAG]), 'name'); - if (Relay::isSolicitedPost($tags, $item['body'], $item['author-id'], $item['uri'], Protocol::ACTIVITYPUB)) { + if (Relay::isSolicitedPost($tags, $item['body'], $item['author-id'], $item['uri'], Protocol::ACTIVITYPUB, $activity['thread-completion'] ?? 0)) { Logger::debug('Post is accepted because of the relay settings', ['uri-id' => $item['uri-id'], 'guid' => $item['guid'], 'url' => $item['uri']]); return true; } else { @@ -1185,7 +1185,7 @@ class Processor if (!empty($item['parent-uri-id'])) { if (Post::exists(['uri-id' => $item['parent-uri-id'], 'uid' => $receiver])) { $has_parents = true; - } elseif ($add_parent && Post::exists(['uri-id' => $item['parent-uri'], 'uid' => 0])) { + } elseif ($add_parent && Post::exists(['uri-id' => $item['parent-uri-id'], 'uid' => 0])) { $stored = Item::storeForUserByUriId($item['parent-uri-id'], $receiver, $fields); $has_parents = (bool)$stored; if ($stored) { @@ -1598,7 +1598,7 @@ class Processor } } - return Relay::isSolicitedPost($messageTags, $body, $authorid, $id, Protocol::ACTIVITYPUB); + return Relay::isSolicitedPost($messageTags, $body, $authorid, $id, Protocol::ACTIVITYPUB, $activity['thread-completion'] ?? 0); } /** diff --git a/src/Protocol/Relay.php b/src/Protocol/Relay.php index ff8276250..4b7eb16d4 100644 --- a/src/Protocol/Relay.php +++ b/src/Protocol/Relay.php @@ -56,7 +56,7 @@ class Relay * @param string $url * @return boolean "true" is the post is wanted by the system */ - public static function isSolicitedPost(array $tags, string $body, int $authorid, string $url, string $network = ''): bool + public static function isSolicitedPost(array $tags, string $body, int $authorid, string $url, string $network = '', int $causerid = 0): bool { $config = DI::config(); @@ -77,6 +77,13 @@ class Relay return false; } + if (!empty($causerid)) { + $contact = Contact::getById($causerid, ['url']); + $causer = $contact['url'] ?? ''; + } else { + $causer = ''; + } + $body = ActivityPub\Processor::normalizeMentionLinks($body); $systemTags = []; @@ -110,19 +117,19 @@ class Relay foreach ($tags as $tag) { $tag = mb_strtolower($tag); if (in_array($tag, $denyTags)) { - Logger::info('Unwanted hashtag found - rejected', ['hashtag' => $tag, 'network' => $network, 'url' => $url]); + Logger::info('Unwanted hashtag found - rejected', ['hashtag' => $tag, 'network' => $network, 'url' => $url, 'causer' => $causer]); return false; } if (in_array($tag, $tagList)) { - Logger::info('Subscribed hashtag found - accepted', ['hashtag' => $tag, 'network' => $network, 'url' => $url]); + Logger::info('Subscribed hashtag found - accepted', ['hashtag' => $tag, 'network' => $network, 'url' => $url, 'causer' => $causer]); return true; } // We check with "strpos" for performance issues. Only when this is true, the regular expression check is used // RegExp is taken from here: https://medium.com/@shiba1014/regex-word-boundaries-with-unicode-207794f6e7ed if ((strpos($content, $tag) !== false) && preg_match('/(?<=[\s,.:;"\']|^)' . preg_quote($tag, '/') . '(?=[\s,.:;"\']|$)/', $content)) { - Logger::info('Subscribed hashtag found in content - accepted', ['hashtag' => $tag, 'network' => $network, 'url' => $url]); + Logger::info('Subscribed hashtag found in content - accepted', ['hashtag' => $tag, 'network' => $network, 'url' => $url, 'causer' => $causer]); return true; } } @@ -135,24 +142,24 @@ class Relay } } - Logger::debug('Got languages', ['languages' => $languages, 'body' => $body]); + Logger::debug('Got languages', ['languages' => $languages, 'body' => $body, 'causer' => $causer]); if (!empty($languages)) { if (in_array($languages[0], $config->get('system', 'relay_deny_languages'))) { - Logger::info('Unwanted language found - rejected', ['language' => $languages[0], 'network' => $network, 'url' => $url]); + Logger::info('Unwanted language found - rejected', ['language' => $languages[0], 'network' => $network, 'url' => $url, 'causer' => $causer]); return false; } } elseif ($config->get('system', 'relay_deny_undetected_language')) { - Logger::info('Undetected language found - rejected', ['body' => $body, 'network' => $network, 'url' => $url]); + Logger::info('Undetected language found - rejected', ['body' => $body, 'network' => $network, 'url' => $url, 'causer' => $causer]); return false; } if ($scope == self::SCOPE_ALL) { - Logger::info('Server accept all posts - accepted', ['network' => $network, 'url' => $url]); + Logger::info('Server accept all posts - accepted', ['network' => $network, 'url' => $url, 'causer' => $causer]); return true; } - Logger::info('No matching hashtags found - rejected', ['network' => $network, 'url' => $url]); + Logger::info('No matching hashtags found - rejected', ['network' => $network, 'url' => $url, 'causer' => $causer]); return false; } From 6965614f0004120285db3aef7089ad10b6f519b6 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 6 Dec 2022 18:47:43 +0000 Subject: [PATCH 3/5] API: Only search for direct hit without offset --- src/Module/Api/Mastodon/Accounts/Search.php | 7 ++++--- src/Module/Api/Mastodon/Search.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Module/Api/Mastodon/Accounts/Search.php b/src/Module/Api/Mastodon/Accounts/Search.php index 616c478b4..d397cf27d 100644 --- a/src/Module/Api/Mastodon/Accounts/Search.php +++ b/src/Module/Api/Mastodon/Accounts/Search.php @@ -29,7 +29,7 @@ use Friendica\Module\BaseApi; use Friendica\Util\Network; /** - * @see https://docs.joinmastodon.org/methods/accounts/ + * @see https://docs.joinmastodon.org/methods/accounts/#search */ class Search extends BaseApi { @@ -44,13 +44,14 @@ class Search extends BaseApi $request = $this->getRequest([ 'q' => '', // What to search for 'limit' => 40, // Maximum number of results. Defaults to 40. + 'offset' => 0, // Offset in search results. Used for pagination. Defaults to 0. 'resolve' => false, // Attempt WebFinger lookup. Defaults to false. Use this when q is an exact address. 'following' => false, // Only who the user is following. Defaults to false. ], $request); $accounts = []; - if ((strrpos($request['q'], '@') > 0) || Network::isValidHttpUrl($request['q'])) { + if (($request['offset'] == 0) && (Network::isValidHttpUrl($request['q']) || (strrpos($request['q'], '@') > 0))) { $id = Contact::getIdForURL($request['q'], 0, $request['resolve'] ? null : false); if (!empty($id)) { @@ -59,7 +60,7 @@ class Search extends BaseApi } if (empty($accounts)) { - $contacts = Contact::searchByName($request['q'], '', $request['following'] ? $uid : 0, $request['limit']); + $contacts = Contact::searchByName($request['q'], '', $request['following'] ? $uid : 0, $request['limit'], $request['offset']); foreach ($contacts as $contact) { $accounts[] = DI::mstdnAccount()->createFromContactId($contact['id'], $uid); } diff --git a/src/Module/Api/Mastodon/Search.php b/src/Module/Api/Mastodon/Search.php index fc9467308..c95422dad 100644 --- a/src/Module/Api/Mastodon/Search.php +++ b/src/Module/Api/Mastodon/Search.php @@ -108,7 +108,7 @@ class Search extends BaseApi private static function searchAccounts(int $uid, string $q, bool $resolve, int $limit, int $offset, bool $following) { if ( - (strrpos($q, '@') > 0 || Network::isValidHttpUrl($q)) + ($offset == 0) && (strrpos($q, '@') > 0 || Network::isValidHttpUrl($q)) && $id = Contact::getIdForURL($q, 0, $resolve ? null : false) ) { return DI::mstdnAccount()->createFromContactId($id, $uid); From e5ff71f8399a186d3f8be1b9d5ee4207c13afacb Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 6 Dec 2022 22:23:43 +0000 Subject: [PATCH 4/5] Fix "Missing hidewall key" --- src/Model/User.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Model/User.php b/src/Model/User.php index 2b8516c25..132e4f11a 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -158,6 +158,7 @@ class User $system['publish'] = false; $system['net-publish'] = false; $system['hide-friends'] = true; + $system['hidewall'] = true; $system['prv_keywords'] = ''; $system['pub_keywords'] = ''; $system['address'] = ''; From 63a628460e70946a48ed5ba0ac65842d5aefb474 Mon Sep 17 00:00:00 2001 From: foss- Date: Wed, 7 Dec 2022 13:16:08 +0100 Subject: [PATCH 5/5] AddTwidereX iOS, Remove deprecated and non-functional clients - add TwidereX to iOS - Remove Twidere Android (currently broken and no longer under development. fun fact: its Google Play link was already going to TwidereX) - Remove B4X Android + iOS (Google Play Link dead https://github.com/AnywhereSoftware/B4X-Pleroma, website unmaintained, no commits for over a year) - Remove Tootle iOS, Linux (repo archived: https://github.com/bleakgrey/tootle, no development in almost 3 years) --- doc/FAQ.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/doc/FAQ.md b/doc/FAQ.md index 63e04a7c3..62b48bd2e 100644 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -178,8 +178,7 @@ The available features are client specific and may differ. #### Android * [AndStatus](http://andstatus.org) ([F-Droid](https://f-droid.org/repository/browse/?fdid=org.andstatus.app), [Google Play](https://play.google.com/store/apps/details?id=org.andstatus.app)) -* [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma) -* [Fedi](https://github.com/Big-Fig/Fediverse.app) ([Google Play](https://play.google.com/store/apps/details?id=com.fediverse.app) +* [Fedi](https://github.com/Big-Fig/Fediverse.app) ([Google Play](https://play.google.com/store/apps/details?id=com.fediverse.app)) * [Fedilab](https://fedilab.app) ([F-Droid](https://f-droid.org/app/fr.gouv.etalab.mastodon), [Google Play](https://play.google.com/store/apps/details?id=app.fedilab.android)) * [Friendiqa](https://git.friendi.ca/lubuwest/Friendiqa) ([F-Droid](https://git.friendi.ca/lubuwest/Friendiqa#install), [Google Play](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa)) * [Husky](https://git.sr.ht/~captainepoch/husky) ([F-Droid](https://f-droid.org/repository/browse/?fdid=su.xash.husky), [Google Play](https://play.google.com/store/apps/details?id=su.xash.husky)) @@ -187,18 +186,16 @@ The available features are client specific and may differ. * [Subway Tooter](https://github.com/tateisu/SubwayTooter) ([F-Droid](https://android.izzysoft.de/repo/apk/jp.juggler.subwaytooter)) * [Tooot](https://tooot.app/) ([Google Play](https://play.google.com/store/apps/details?id=com.xmflsct.app.tooot)) * [Tusky](https://tusky.app) ([F-Droid](https://f-droid.org/repository/browse/?fdid=com.keylesspalace.tusky), [Google Play](https://play.google.com/store/apps/details?id=com.keylesspalace.tusky)) -* [Twidere](https://github.com/TwidereProject/Twidere-Android) ([F-Droid](https://f-droid.org/repository/browse/?fdid=org.mariotaku.twidere), [Google Play](https://play.google.com/store/apps/details?id=com.twidere.twiderex)) * [TwidereX](https://github.com/TwidereProject/TwidereX-Android) ([F-Droid](https://f-droid.org/en/packages/com.twidere.twiderex/), [Google Play](https://play.google.com/store/apps/details?id=com.twidere.twiderex)) * [Yuito](https://github.com/accelforce/Yuito) ([Google Play](https://play.google.com/store/apps/details?id=net.accelf.yuito)) #### iOS -* [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma) ([AppStore](https://apps.apple.com/app/b4x-pleroma/id1538396871)) * [Fedi](https://github.com/Big-Fig/Fediverse.app) ([AppStore](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281)) -* [Mastodon for iPhone and iPad](https://joinmastodon.org/apps) ([AppStore](https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974)) +* [Mastodon](https://joinmastodon.org/apps) ([AppStore](https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974)) * [Stella*](https://www.stella-app.net/) ([AppStore](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048)) -* [Tooot](https://github.com/tooot-app) ([AppStore](https://apps.apple.com/app/id1549772269), Data collection (not linked to identity) -* [Tootle](https://mastodon.cloud/@tootleapp) ([AppStore](https://apps.apple.com/de/app/tootle-for-mastodon/id1236013466)), last update: 2020 +* [Tooot](https://github.com/tooot-app) ([AppStore](https://apps.apple.com/app/id1549772269) +* [TwidereX](https://github.com/TwidereProject/TwidereX-iOS) ([AppStore](https://apps.apple.com/app/twidere-x/id1530314034)) #### Linux @@ -206,7 +203,6 @@ The available features are client specific and may differ. * [Whalebird](https://whalebird.social/en/desktop/contents) ([GitHub](https://github.com/h3poteto/whalebird-desktop)) * [TheDesk](https://thedesk.top/en/) ([GitHub](https://github.com/cutls/TheDesk)) * [Toot](https://toot.readthedocs.io/en/latest/) -* [Tootle](https://github.com/bleakgrey/tootle) #### macOS