From 1ba6c51364c53fdae35d93fb4fc9019a4a7d78dd Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 13 Jun 2021 17:38:34 +0000 Subject: [PATCH 1/8] Issue 10386: Reworked match --- mod/match.php | 89 ++++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/mod/match.php b/mod/match.php index 29d4e086a..fcaf8b529 100644 --- a/mod/match.php +++ b/mod/match.php @@ -66,54 +66,27 @@ function match_content(App $a) $params = []; $tags = trim($profile['pub_keywords'] . ' ' . $profile['prv_keywords']); + if (DI::mode()->isMobile()) { + $limit = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network', + DI::config()->get('system', 'itemspage_network_mobile')); + } else { + $limit = DI::pConfig()->get(local_user(), 'system', 'itemspage_network', + DI::config()->get('system', 'itemspage_network')); + } + $params['s'] = $tags; $params['n'] = 100; - if (strlen(DI::config()->get('system', 'directory'))) { - $host = Search::getGlobalDirectory(); - } else { - $host = DI::baseUrl(); - } - - $msearch_json = DI::httpRequest()->post($host . '/msearch', $params)->getBody(); - - $msearch = json_decode($msearch_json); - - $start = $_GET['start'] ?? 0; $entries = []; - $paginate = ''; - - if (!empty($msearch->results)) { - for ($i = $start;count($entries) < 10 && $i < $msearch->total; $i++) { - $profile = $msearch->results[$i]; - - // Already known contact - if (!$profile || Contact::getIdForURL($profile->url, local_user())) { - continue; - } - - $contact = Contact::getByURLForUser($profile->url, local_user()); - if (!empty($contact)) { - $entries[] = ModuleContact::getContactTemplateVars($contact); - } + foreach ([Search::getGlobalDirectory(), DI::baseUrl()] as $server) { + if (empty($server)) { + continue; } - $data = [ - 'class' => 'pager', - 'first' => [ - 'url' => 'match', - 'text' => DI::l10n()->t('first'), - 'class' => 'previous' . ($start == 0 ? 'disabled' : '') - ], - 'next' => [ - 'url' => 'match?start=' . $i, - 'text' => DI::l10n()->t('next'), - 'class' => 'next' . ($i >= $msearch->total ? ' disabled' : '') - ] - ]; - - $tpl = Renderer::getMarkupTemplate('paginate.tpl'); - $paginate = Renderer::replaceMacros($tpl, ['pager' => $data]); + $msearch = json_decode(DI::httpRequest()->post($server . '/msearch', $params)->getBody()); + if (!empty($msearch)) { + $entries = match_get_contacts($msearch, $entries, $limit); + } } if (empty($entries)) { @@ -123,9 +96,37 @@ function match_content(App $a) $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl'); $o = Renderer::replaceMacros($tpl, [ '$title' => DI::l10n()->t('Profile Match'), - '$contacts' => $entries, - '$paginate' => $paginate + '$contacts' => array_slice($entries, 0, $limit), ]); return $o; } + +function match_get_contacts($msearch, $entries, $limit) +{ + if (empty($msearch->results)) { + return $entries; + } + + foreach ($msearch->results as $profile) { + if (!$profile) { + continue; + } + + // Already known contact + $contact = Contact::getByURL($profile->url, null, ['rel'], local_user()); + if (!empty($contact) && in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) { + continue; + } + + $contact = Contact::getByURLForUser($profile->url, local_user()); + if (!empty($contact)) { + $entries[$contact['id']] = ModuleContact::getContactTemplateVars($contact); + } + + if (count($entries) == $limit) { + break; + } + } + return $entries; +} \ No newline at end of file From 63d2bbcfa06f5f1ceea812ce98e540f0accc29ca Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 13 Jun 2021 17:56:06 +0000 Subject: [PATCH 2/8] Updated messages.po --- view/lang/C/messages.po | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 5e9941df4..93cfa0fc3 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2021.06-rc\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-06-10 06:29+0000\n" +"POT-Creation-Date: 2021-06-13 17:55+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,26 +18,26 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" -#: include/api.php:1143 +#: include/api.php:1135 #, php-format msgid "Daily posting limit of %d post reached. The post was rejected." msgid_plural "Daily posting limit of %d posts reached. The post was rejected." msgstr[0] "" msgstr[1] "" -#: include/api.php:1157 +#: include/api.php:1149 #, php-format msgid "Weekly posting limit of %d post reached. The post was rejected." msgid_plural "Weekly posting limit of %d posts reached. The post was rejected." msgstr[0] "" msgstr[1] "" -#: include/api.php:1171 +#: include/api.php:1163 #, php-format msgid "Monthly posting limit of %d post reached. The post was rejected." msgstr "" -#: include/api.php:4534 mod/photos.php:107 mod/photos.php:211 +#: include/api.php:4526 mod/photos.php:107 mod/photos.php:211 #: mod/photos.php:639 mod/photos.php:1043 mod/photos.php:1060 #: mod/photos.php:1609 src/Model/User.php:1100 src/Model/User.php:1108 #: src/Model/User.php:1116 src/Module/Settings/Profile/Photo/Crop.php:97 @@ -1599,19 +1599,11 @@ msgstr "" msgid "No keywords to match. Please add keywords to your profile." msgstr "" -#: mod/match.php:105 src/Content/Pager.php:216 -msgid "first" -msgstr "" - -#: mod/match.php:110 src/Content/Pager.php:276 -msgid "next" -msgstr "" - -#: mod/match.php:120 src/Module/BaseSearch.php:117 +#: mod/match.php:93 src/Module/BaseSearch.php:117 msgid "No matches" msgstr "" -#: mod/match.php:125 +#: mod/match.php:98 msgid "Profile Match" msgstr "" @@ -3626,10 +3618,18 @@ msgstr "" msgid "Embedded content" msgstr "" +#: src/Content/Pager.php:216 +msgid "first" +msgstr "" + #: src/Content/Pager.php:221 msgid "prev" msgstr "" +#: src/Content/Pager.php:276 +msgid "next" +msgstr "" + #: src/Content/Pager.php:281 msgid "last" msgstr "" @@ -5234,7 +5234,7 @@ msgstr "" #: src/Module/Admin/Addons/Details.php:111 src/Module/Admin/Addons/Index.php:67 #: src/Module/Admin/Blocklist/Contact.php:78 -#: src/Module/Admin/Blocklist/Server.php:88 src/Module/Admin/Federation.php:141 +#: src/Module/Admin/Blocklist/Server.php:88 src/Module/Admin/Federation.php:159 #: src/Module/Admin/Item/Delete.php:65 src/Module/Admin/Logs/Settings.php:80 #: src/Module/Admin/Logs/View.php:64 src/Module/Admin/Queue.php:72 #: src/Module/Admin/Site.php:579 src/Module/Admin/Summary.php:232 @@ -5567,26 +5567,26 @@ msgstr "" msgid "Manage Additional Features" msgstr "" -#: src/Module/Admin/Federation.php:54 +#: src/Module/Admin/Federation.php:56 msgid "Other" msgstr "" -#: src/Module/Admin/Federation.php:108 src/Module/Admin/Federation.php:268 +#: src/Module/Admin/Federation.php:118 src/Module/Admin/Federation.php:348 msgid "unknown" msgstr "" -#: src/Module/Admin/Federation.php:136 +#: src/Module/Admin/Federation.php:154 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 "" -#: src/Module/Admin/Federation.php:142 src/Module/BaseAdmin.php:87 +#: src/Module/Admin/Federation.php:160 src/Module/BaseAdmin.php:87 msgid "Federation Statistics" msgstr "" -#: src/Module/Admin/Federation.php:146 +#: src/Module/Admin/Federation.php:164 #, php-format msgid "" "Currently this node is aware of %d nodes with %d registered users from the " @@ -8881,15 +8881,15 @@ msgstr "" msgid "Show all" msgstr "" -#: src/Module/OAuth/Authorize.php:53 +#: src/Module/OAuth/Authorize.php:54 msgid "Unsupported or missing response type" msgstr "" -#: src/Module/OAuth/Authorize.php:58 src/Module/OAuth/Token.php:58 +#: src/Module/OAuth/Authorize.php:59 src/Module/OAuth/Token.php:58 msgid "Incomplete request data" msgstr "" -#: src/Module/OAuth/Authorize.php:108 +#: src/Module/OAuth/Authorize.php:106 #, php-format msgid "" "Please copy the following authentication code into your application and " From fdd0b4de140a8dff98525543aec02ac6518b22d0 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 14 Jun 2021 16:30:31 +0000 Subject: [PATCH 3/8] Documentation: The list of supported clients had been reworked --- doc/API-Mastodon.md | 31 +++------------------- doc/FAQ.md | 57 ++++++++++++++++++++++++++++------------ doc/de/FAQ.md | 64 ++++++++++++++++++++++++++++----------------- doc/de/Home.md | 2 +- 4 files changed, 85 insertions(+), 69 deletions(-) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index db70d9fce..b01de4eb3 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -13,44 +13,21 @@ Authentication is the same as described in [Using the APIs](help/api#Authenticat ### Supported apps -#### Android - -- [AndStatus](http://andstatus.org) -- [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma) -- [Fedi](https://play.google.com/store/apps/details?id=com.fediverse.app) -- [Husky](https://husky.fwgs.ru) -- [Roma](https://play.google.com/store/apps/details?id=tech.bigfig.roma) -- [Subway Tooter](https://github.com/tateisu/SubwayTooter) -- [Tooot](https://tooot.app/) -- [Tusky](https://tusky.app) -- [Twidere](https://github.com/TwidereProject/) -- [twitlatte](https://github.com/moko256/twitlatte) -- [Yuito](https://github.com/accelforce/Yuito) - -#### iOS -- [Amaroq](https://github.com/ReticentJohn/Amaroq/tree/master) -- [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma) -- [Fedi](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281) -- [Roma](https://apps.apple.com/de/app/roma-for-pleroma-and-mastodon/id1445328699) -- [StarPterano](https://apps.apple.com/de/app/starpterano/id1436972796) Uses an OAuth method where you have to manually copy and paste the provided code. -- [Stella](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048?l=ms) -- [Tooot](https://tooot.app/) -- [Tootle](https://apps.apple.com/de/app/tootle-for-mastodon/id1236013466) entered hostname must match in upper/lower case. Currently crashes on "Status" type notifications. - -#### Desktop -- [Whalebird](https://whalebird.social) +For supported apps please have a look at the [FAQ](help/FAQ#clients) ### Unsupported apps #### Android + - [Fedilab](https://framagit.org/tom79/fedilab) Automatically uses the legacy API, see issue: https://framagit.org/tom79/fedilab/-/issues/520 - [Mammut](https://github.com/jamiesanson/Mammut) There are problems with the token request, see issue https://github.com/jamiesanson/Mammut/issues/19 #### iOS + - [Mast](https://github.com/Beesitech/Mast) Doesn't accept the entered instance name. Claims that it is invalid (Message is: "Not a valid instance (may be closed or dead)") - [Toot!](https://apps.apple.com/app/toot/id1229021451) -#### Other +#### Desktop - [Halycon](https://www.halcyon.social/) Doesn't load content, creates masses of HTTP requests - [Mastonaut](https://mastonaut.app/) diff --git a/doc/FAQ.md b/doc/FAQ.md index a073585f1..2bbe20959 100644 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -183,25 +183,48 @@ Example: Friendica Support ### What friendica clients can I use? Friendica is using a [Twitter/GNU Social compatible API](help/api), which means you can use any Twitter/GNU Social client for your platform as long as you can change the API path in its settings. -Since the 2021.06 release, Friendica also supports the Mastodon API. +Since the 2021.06 release, Friendica also supports the [Mastodon API](help/API-Mastodon) which works with a lot of Mastodon clients. Here is a list of known working clients: -* 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)) - * [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)) - * [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)) - * [Twidere](https://dimension.im/) ([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), [GitHub](https://github.com/TwidereProject/Twidere-Android)) -* SailfishOS - * [Friendly](https://openrepos.net/content/fabrixxm/friendly#comment-form) -* Linux - * [Choqok](https://choqok.kde.org) -* Windows - * [Friendica Mobile](https://www.microsoft.com/de-DE/store/p/friendica-mobile/9nblggh0fhmn?rtc=1) (Windows 10) - * [Husky](https://husky.fwgs.ru) - * [Subway Tooter](https://github.com/tateisu/SubwayTooter) - * [Tusky](https://tusky.app) - * [twitlatte](https://github.com/moko256/twitlatte) - * [Yuito](https://github.com/accelforce/Yuito) +#### 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) +* [DiCa](https://dica.mixi.cool/) (Available at Google Play) +* [Fedi](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://husky.fwgs.ru) +* [Roma](https://play.google.com/store/apps/details?id=tech.bigfig.roma) +* [Subway Tooter](https://github.com/tateisu/SubwayTooter) +* [Tooot](https://tooot.app/) +* [Tusky](https://tusky.app) +* [Twidere](https://dimension.im/) ([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), [GitHub](https://github.com/TwidereProject/Twidere-Android)) +* [twitlatte](https://github.com/moko256/twitlatte) +* [Yuito](https://github.com/accelforce/Yuito) + +#### SailfishOS +* [Friendly](https://openrepos.net/content/fabrixxm/friendly#comment-form) +#### iOS + +* [Amaroq](https://github.com/ReticentJohn/Amaroq/tree/master) +* [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma) +* [Fedi](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281) +* [Roma](https://apps.apple.com/de/app/roma-for-pleroma-and-mastodon/id1445328699) +* [StarPterano](https://apps.apple.com/de/app/starpterano/id1436972796) Uses an OAuth method where you have to manually copy and paste the provided code. +* [Stella](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048?l=ms) +* [Tooot](https://tooot.app/) +* [Tootle](https://apps.apple.com/de/app/tootle-for-mastodon/id1236013466) entered hostname must match in upper/lower case. Currently crashes on "Status" type notifications. + +#### Linux + +* [Choqok](https://choqok.kde.org) +* [Whalebird](https://whalebird.social) +* [TheDesk](https://ja.mstdn.wiki/TheDesk) +* [Toot](https://toot.readthedocs.io/en/latest/) +* [Tootle](https://github.com/bleakgrey/tootle) +#### Windows +* [Friendica Mobile](https://www.microsoft.com/de-DE/store/p/friendica-mobile/9nblggh0fhmn?rtc=1) (Windows 10) Depending on the features of the client you might encounter some glitches in usability, like being limited in the length of your postings to 140 characters and having no access to the [permission settings](help/Groups-and-Privacy). diff --git a/doc/de/FAQ.md b/doc/de/FAQ.md index a5356cc72..f8c7093c5 100644 --- a/doc/de/FAQ.md +++ b/doc/de/FAQ.md @@ -193,33 +193,49 @@ Beispiel: Friendica Support ### Gibt es Clients für Friendica? Friendica verwendet eine [Twitter/GNU Social](help/api) kompatible API. -Seit der Version 2021.06 unterstützt Friendica außerdem die Mastodon API. Das bedeutet, dass du jeden Twitter/GNU Social Client verwenden kannst in dem du den API Pfad entsprechend änderst. +Seit der Version 2021.06 unterstützt Friendica außerdem die [Mastodon API](help/API-Mastodon) die mit vielen Mastodon-Clients läuft. -Hier ist eine Liste von Clients bei denen dies möglich ist, bzw. die speziell für Friendica entwickelt werden: +Hier ist eine Liste von Clients, die speziell für Friendica entwickelt werden oder die mit Friendica kompatibel sind: -* Android - * [Friendiqa](https://git.friendi.ca/lubuwest/Friendiqa) (Gibt es im Google Playstore oder als [binary Repository](https://freunde.ma-nic.de/display/3e98eba8185a13c5bdbf3d1539646854) für F-Droid) - * [Fedilab](https://gitlab.com/tom79/mastalab) (Gibt es im F-Droid und dem Google Play Store) - * [DiCa](https://dica.mixi.cool/) (Gibt es bei Google Play) - * AndStatus - * Twidere - * Mustard and Mustard-Mod -* SailfishOS - * [Friendly](https://openrepos.net/content/fabrixxm/friendly#comment-form) - * [Husky](https://husky.fwgs.ru) - * [Subway Tooter](https://github.com/tateisu/SubwayTooter) - * [Tusky](https://tusky.app) - * [twitlatte](https://github.com/moko256/twitlatte) - * [Yuito](https://github.com/accelforce/Yuito) -* Linux - * Hotot - * Choqok -* MacOS X - * Hotot -* Windows - * [Friendica Mobile](https://www.microsoft.com/de-DE/store/p/friendica-mobile/9nblggh0fhmn?rtc=1) für Windows 10 - * Hotot +#### 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) +* [DiCa](https://dica.mixi.cool/) (Gibt es bei Google Play) +* [Fedi](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) (Gibt es im Google Playstore oder als [binary Repository](https://freunde.ma-nic.de/display/3e98eba8185a13c5bdbf3d1539646854) für F-Droid) +* [Husky](https://husky.fwgs.ru) +* [Roma](https://play.google.com/store/apps/details?id=tech.bigfig.roma) +* [Subway Tooter](https://github.com/tateisu/SubwayTooter) +* [Tooot](https://tooot.app/) +* [Tusky](https://tusky.app) +* [Twidere](https://dimension.im/) ([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), [GitHub](https://github.com/TwidereProject/Twidere-Android)) +* [twitlatte](https://github.com/moko256/twitlatte) +* [Yuito](https://github.com/accelforce/Yuito) + +#### SailfishOS +* [Friendly](https://openrepos.net/content/fabrixxm/friendly#comment-form) + +#### iOS +- [Amaroq](https://github.com/ReticentJohn/Amaroq/tree/master) +- [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma) +- [Fedi](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281) +- [Roma](https://apps.apple.com/de/app/roma-for-pleroma-and-mastodon/id1445328699) +- [StarPterano](https://apps.apple.com/de/app/starpterano/id1436972796) +- [Stella](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048?l=ms) +- [Tooot](https://tooot.app/) +- [Tootle](https://apps.apple.com/de/app/tootle-for-mastodon/id1236013466) Der eingegene Hostname muss in Groß-/Kleinschreibung mit dem Hostnamen des Systems übereinstimmen. Die aktuelle Version stürzt bei Benachrichtungen bom Typ "status" ab. + +#### Linux +* [Choqok](https://choqok.kde.org) +* [Whalebird](https://whalebird.social) +* [TheDesk](https://ja.mstdn.wiki/TheDesk) +* [Toot](https://toot.readthedocs.io/en/latest/) +* [Tootle](https://github.com/bleakgrey/tootle) + +#### Windows +* [Friendica Mobile](https://www.microsoft.com/de-DE/store/p/friendica-mobile/9nblggh0fhmn?rtc=1) für Windows 10 Admin -------- diff --git a/doc/de/Home.md b/doc/de/Home.md index 6f7e57599..30b796115 100644 --- a/doc/de/Home.md +++ b/doc/de/Home.md @@ -54,7 +54,7 @@ Friendica - Dokumentation und Ressourcen * [Class Autoloading](help/autoloader) (EN) * [Using Composer](help/Composer) (EN) * [Code-Referenz (mit doxygen generiert - setzt Cookies)](doc/html/) -* [Twitter/GNU Social API Functions](help/api) (EN) +* [API Dokumentation](help/api) (EN) * [Translation of Friendica](help/translations) (EN) * [Run tests](help/Tests) (EN) From d348e4afca7bac43bd1d21c9c1ced0622429afbe Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 14 Jun 2021 18:34:11 +0000 Subject: [PATCH 4/8] Possibly fixes notice "Undefined index: private in .../src/Model/Item.php on line 3115" --- src/Model/Event.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Event.php b/src/Model/Event.php index c59baba9c..81e33013f 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -586,10 +586,10 @@ 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'], ['id' => $event['itemid']]); + $item = Post::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link', 'private'], ['id' => $event['itemid']]); if (!DBA::isResult($item)) { // Using default values when no item had been found - $item = ['plink' => '', 'author-name' => '', 'author-avatar' => '', 'author-link' => '']; + $item = ['plink' => '', 'author-name' => '', 'author-avatar' => '', 'author-link' => '', 'private' => Item::PUBLIC]; } $event = array_merge($event, $item); From 4a69b53d98894dc831460cf59654604c64c37f3a Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 15 Jun 2021 19:19:34 +0200 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: Hypolite Petovan --- doc/FAQ.md | 6 +++++- doc/de/FAQ.md | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/FAQ.md b/doc/FAQ.md index 2bbe20959..0819ab288 100644 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -183,7 +183,7 @@ Example: Friendica Support ### What friendica clients can I use? Friendica is using a [Twitter/GNU Social compatible API](help/api), which means you can use any Twitter/GNU Social client for your platform as long as you can change the API path in its settings. -Since the 2021.06 release, Friendica also supports the [Mastodon API](help/API-Mastodon) which works with a lot of Mastodon clients. +Since the 2021.06 release, Friendica also supports the [Mastodon API](help/API-Mastodon) which works with many Mastodon clients. Here is a list of known working clients: #### Android @@ -204,7 +204,9 @@ Here is a list of known working clients: * [Yuito](https://github.com/accelforce/Yuito) #### SailfishOS + * [Friendly](https://openrepos.net/content/fabrixxm/friendly#comment-form) + #### iOS * [Amaroq](https://github.com/ReticentJohn/Amaroq/tree/master) @@ -223,7 +225,9 @@ Here is a list of known working clients: * [TheDesk](https://ja.mstdn.wiki/TheDesk) * [Toot](https://toot.readthedocs.io/en/latest/) * [Tootle](https://github.com/bleakgrey/tootle) + #### Windows + * [Friendica Mobile](https://www.microsoft.com/de-DE/store/p/friendica-mobile/9nblggh0fhmn?rtc=1) (Windows 10) Depending on the features of the client you might encounter some glitches in usability, like being limited in the length of your postings to 140 characters and having no access to the [permission settings](help/Groups-and-Privacy). diff --git a/doc/de/FAQ.md b/doc/de/FAQ.md index f8c7093c5..be1605df9 100644 --- a/doc/de/FAQ.md +++ b/doc/de/FAQ.md @@ -199,6 +199,7 @@ Seit der Version 2021.06 unterstützt Friendica außerdem die [Mastodon API](hel Hier ist eine Liste von Clients, die speziell für Friendica entwickelt werden oder die mit Friendica kompatibel sind: #### 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) * [DiCa](https://dica.mixi.cool/) (Gibt es bei Google Play) @@ -215,9 +216,11 @@ Hier ist eine Liste von Clients, die speziell für Friendica entwickelt werden o * [Yuito](https://github.com/accelforce/Yuito) #### SailfishOS + * [Friendly](https://openrepos.net/content/fabrixxm/friendly#comment-form) #### iOS + - [Amaroq](https://github.com/ReticentJohn/Amaroq/tree/master) - [B4X for Pleroma & Mastodon](https://github.com/AnywhereSoftware/B4X-Pleroma) - [Fedi](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281) @@ -228,6 +231,7 @@ Hier ist eine Liste von Clients, die speziell für Friendica entwickelt werden o - [Tootle](https://apps.apple.com/de/app/tootle-for-mastodon/id1236013466) Der eingegene Hostname muss in Groß-/Kleinschreibung mit dem Hostnamen des Systems übereinstimmen. Die aktuelle Version stürzt bei Benachrichtungen bom Typ "status" ab. #### Linux + * [Choqok](https://choqok.kde.org) * [Whalebird](https://whalebird.social) * [TheDesk](https://ja.mstdn.wiki/TheDesk) @@ -235,6 +239,7 @@ Hier ist eine Liste von Clients, die speziell für Friendica entwickelt werden o * [Tootle](https://github.com/bleakgrey/tootle) #### Windows + * [Friendica Mobile](https://www.microsoft.com/de-DE/store/p/friendica-mobile/9nblggh0fhmn?rtc=1) für Windows 10 Admin From 09c77e3774f520bb3feeebfdf05bf3d8e5e50734 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Jun 2021 17:23:08 +0000 Subject: [PATCH 6/8] Updated messages.po --- view/lang/C/messages.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 4e0cd47c3..3a4997842 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2021.06-rc\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-06-13 11:02+0000\n" +"POT-Creation-Date: 2021-06-15 17:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -4489,33 +4489,33 @@ msgstr "" msgid "Done. You can now login with your username and password" msgstr "" -#: src/Database/DBStructure.php:64 +#: src/Database/DBStructure.php:65 #, php-format msgid "The database version had been set to %s." msgstr "" -#: src/Database/DBStructure.php:77 +#: src/Database/DBStructure.php:78 #, php-format msgid "" "The post update is at version %d, it has to be at %d to safely drop the " "tables." msgstr "" -#: src/Database/DBStructure.php:89 +#: src/Database/DBStructure.php:90 msgid "No unused tables found." msgstr "" -#: src/Database/DBStructure.php:94 +#: src/Database/DBStructure.php:95 msgid "" "These tables are not used for friendica and will be deleted when you execute " "\"dbstructure drop -e\":" msgstr "" -#: src/Database/DBStructure.php:132 +#: src/Database/DBStructure.php:133 msgid "There are no tables on MyISAM or InnoDB with the Antelope file format." msgstr "" -#: src/Database/DBStructure.php:156 +#: src/Database/DBStructure.php:157 #, php-format msgid "" "\n" @@ -4523,20 +4523,20 @@ msgid "" "%s\n" msgstr "" -#: src/Database/DBStructure.php:159 +#: src/Database/DBStructure.php:160 msgid "Errors encountered performing database changes: " msgstr "" -#: src/Database/DBStructure.php:445 +#: src/Database/DBStructure.php:550 msgid "Another database update is currently running." msgstr "" -#: src/Database/DBStructure.php:449 +#: src/Database/DBStructure.php:554 #, php-format msgid "%s: Database update" msgstr "" -#: src/Database/DBStructure.php:749 +#: src/Database/DBStructure.php:854 #, php-format msgid "%s: updating %s table." msgstr "" From e994d02791b8879ab5d338650f199759d3012074 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Jun 2021 21:39:28 +0000 Subject: [PATCH 7/8] Add a profile entry if missing --- src/Model/User.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/User.php b/src/Model/User.php index 029613b17..641148f74 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -391,7 +391,12 @@ class User if (!DBA::exists('user', ['uid' => $uid]) || !$repairMissing) { return false; } - Contact::createSelfFromUserId($uid); + if (!DBA::exists('contact', ['uid' => $uid, 'self' => true])) { + Contact::createSelfFromUserId($uid); + } + if (!DBA::exists('profile', ['uid' => $uid])) { + DBA::insert('profile', ['uid' => $uid]); + } $owner = self::getOwnerDataById($uid, false); } From c17f23423f358919fcc03c1ae77a5f0960e2bde8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Jun 2021 22:01:30 +0000 Subject: [PATCH 8/8] Chec for missing profile first --- src/Model/User.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/User.php b/src/Model/User.php index 641148f74..a615f96bb 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -391,12 +391,12 @@ class User if (!DBA::exists('user', ['uid' => $uid]) || !$repairMissing) { return false; } - if (!DBA::exists('contact', ['uid' => $uid, 'self' => true])) { - Contact::createSelfFromUserId($uid); - } if (!DBA::exists('profile', ['uid' => $uid])) { DBA::insert('profile', ['uid' => $uid]); } + if (!DBA::exists('contact', ['uid' => $uid, 'self' => true])) { + Contact::createSelfFromUserId($uid); + } $owner = self::getOwnerDataById($uid, false); }