diff --git a/database.sql b/database.sql index 38cc39154..009a20fa0 100644 --- a/database.sql +++ b/database.sql @@ -1,5 +1,5 @@ -- ------------------------------------------ --- Friendica 2022.06 (Giant Rhubarb) +-- Friendica 2022.09-dev (Giant Rhubarb) -- DB_UPDATE_VERSION 1469 -- ------------------------------------------ diff --git a/images/default/diaspora.png b/images/default/diaspora.png new file mode 100644 index 000000000..53d10ffc0 Binary files /dev/null and b/images/default/diaspora.png differ diff --git a/images/default/mastodon.png b/images/default/mastodon.png new file mode 100644 index 000000000..34c8e45e6 Binary files /dev/null and b/images/default/mastodon.png differ diff --git a/images/default/peertube-account.png b/images/default/peertube-account.png new file mode 100644 index 000000000..0bedaa0c8 Binary files /dev/null and b/images/default/peertube-account.png differ diff --git a/images/default/peertube-channel.png b/images/default/peertube-channel.png new file mode 100644 index 000000000..e24741815 Binary files /dev/null and b/images/default/peertube-channel.png differ diff --git a/images/default/pleroma.png b/images/default/pleroma.png new file mode 100644 index 000000000..df4e2d233 Binary files /dev/null and b/images/default/pleroma.png differ diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 59b14ad0f..fedf6c839 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1817,6 +1817,67 @@ class Contact } if (!DI::config()->get('system', 'remote_avatar_lookup')) { + $platform = ''; + $type = Contact::TYPE_PERSON; + + if (!empty($contact['id'])) { + $account = DBA::selectFirst('account-user-view', ['platform', 'contact-type'], ['id' => $contact['id']]); + $platform = $account['platform'] ?? ''; + $type = $account['contact-type'] ?? Contact::TYPE_PERSON; + } + + if (empty($platform) && !empty($contact['uri-id'])) { + $account = DBA::selectFirst('account-user-view', ['platform', 'contact-type'], ['uri-id' => $contact['uri-id']]); + $platform = $account['platform'] ?? ''; + $type = $account['contact-type'] ?? Contact::TYPE_PERSON; + } + + switch ($platform) { + case 'mastodon': + /** + * Picture credits + * @license GNU Affero General Public License v3.0 + * @link https://github.com/mastodon/mastodon/tree/main/public/avatars/original/missing.png + */ + $default = '/images/default/mastodon.png'; + break; + + case 'pleroma': + /** + * Picture credits + * @license GNU Affero General Public License v3.0 + * @link https://git.pleroma.social/pleroma/pleroma/-/blob/develop/priv/static/images/avi.png + */ + $default = '/images/default/pleroma.png'; + break; + + case 'diaspora': + /** + * Picture credits + * @license GNU Affero General Public License v3.0 + * @link https://github.com/diaspora/diaspora/ + */ + $default = '/images/default/diaspora.png'; + break; + + case 'peertube': + if ($type == Contact::TYPE_COMMUNITY) { + /** + * Picture credits + * @license GNU Affero General Public License v3.0 + * @link https://github.com/Chocobozzz/PeerTube/blob/develop/client/src/assets/images/default-avatar-video-channel.png + */ + $default = '/images/default/peertube-channel.png'; + } else { + /** + * Picture credits + * @license GNU Affero General Public License v3.0 + * @link https://github.com/Chocobozzz/PeerTube/blob/develop/client/src/assets/images/default-avatar-account.png + */ + $default = '/images/default/peertube-account.png'; + } + break; + } return DI::baseUrl() . $default; } diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 134cade65..86c737aa4 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -270,7 +270,7 @@ class Photo extends BaseModule return MPhoto::createPhotoForExternalResource($link['url'], (int)local_user(), $link['mimetype']); case "contact": - $fields = ['uid', 'url', 'nurl', 'avatar', 'photo', 'xmpp', 'addr', 'network', 'failed', 'updated']; + $fields = ['uid', 'uri-id', 'url', 'nurl', 'avatar', 'photo', 'xmpp', 'addr', 'network', 'failed', 'updated']; $contact = Contact::getById($id, $fields); if (empty($contact)) { return false; diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index b8d98f947..333a0aaa6 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 2022.06\n" +"Project-Id-Version: 2022.09-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-06 07:33+0000\n" +"POT-Creation-Date: 2022-06-13 05:45+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,7 +37,7 @@ msgstr "" msgid "User not found." msgstr "" -#: mod/cal.php:122 mod/display.php:247 src/Module/Profile/Profile.php:94 +#: mod/cal.php:122 mod/display.php:262 src/Module/Profile/Profile.php:94 #: src/Module/Profile/Profile.php:109 src/Module/Profile/Status.php:110 #: src/Module/Update/Profile.php:56 msgid "Access to this profile has been restricted." @@ -104,17 +104,17 @@ msgstr "" msgid "calendar" msgstr "" -#: mod/display.php:142 mod/photos.php:802 +#: mod/display.php:143 mod/photos.php:802 #: src/Module/Conversation/Community.php:175 src/Module/Directory.php:49 #: src/Module/Search/Index.php:50 msgid "Public access denied." msgstr "" -#: mod/display.php:198 mod/display.php:272 +#: mod/display.php:213 mod/display.php:287 msgid "The requested item doesn't exist or has been deleted." msgstr "" -#: mod/display.php:352 +#: mod/display.php:367 msgid "The feed for this item is unavailable." msgstr "" @@ -230,7 +230,7 @@ msgstr "" #: mod/editpost.php:107 mod/message.php:200 mod/message.php:358 #: mod/photos.php:1489 mod/wallmessage.php:142 src/Content/Conversation.php:368 -#: src/Content/Conversation.php:712 src/Module/Item/Compose.php:177 +#: src/Content/Conversation.php:713 src/Module/Item/Compose.php:177 #: src/Object/Post.php:528 msgid "Please wait" msgstr "" @@ -1077,11 +1077,11 @@ msgstr "" msgid "Comment" msgstr "" -#: mod/photos.php:1424 src/Content/Conversation.php:628 src/Object/Post.php:247 +#: mod/photos.php:1424 src/Content/Conversation.php:629 src/Object/Post.php:247 msgid "Select" msgstr "" -#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:629 +#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:630 #: src/Module/Admin/Users/Active.php:139 src/Module/Admin/Users/Blocked.php:140 #: src/Module/Admin/Users/Index.php:153 msgid "Delete" @@ -1942,7 +1942,7 @@ msgid "%s attends maybe." msgstr "" #: src/Content/Conversation.php:222 src/Content/Conversation.php:260 -#: src/Content/Conversation.php:872 +#: src/Content/Conversation.php:873 #, php-format msgid "%s reshared this." msgstr "" @@ -2061,92 +2061,92 @@ msgstr "" msgid "Scheduled at" msgstr "" -#: src/Content/Conversation.php:656 src/Object/Post.php:235 +#: src/Content/Conversation.php:657 src/Object/Post.php:235 msgid "Pinned item" msgstr "" -#: src/Content/Conversation.php:672 src/Object/Post.php:476 +#: src/Content/Conversation.php:673 src/Object/Post.php:476 #: src/Object/Post.php:477 #, php-format msgid "View %s's profile @ %s" msgstr "" -#: src/Content/Conversation.php:685 src/Object/Post.php:464 +#: src/Content/Conversation.php:686 src/Object/Post.php:464 msgid "Categories:" msgstr "" -#: src/Content/Conversation.php:686 src/Object/Post.php:465 +#: src/Content/Conversation.php:687 src/Object/Post.php:465 msgid "Filed under:" msgstr "" -#: src/Content/Conversation.php:694 src/Object/Post.php:490 +#: src/Content/Conversation.php:695 src/Object/Post.php:490 #, php-format msgid "%s from %s" msgstr "" -#: src/Content/Conversation.php:710 +#: src/Content/Conversation.php:711 msgid "View in context" msgstr "" -#: src/Content/Conversation.php:775 +#: src/Content/Conversation.php:776 msgid "remove" msgstr "" -#: src/Content/Conversation.php:779 +#: src/Content/Conversation.php:780 msgid "Delete Selected Items" msgstr "" -#: src/Content/Conversation.php:844 src/Content/Conversation.php:847 -#: src/Content/Conversation.php:850 src/Content/Conversation.php:853 +#: src/Content/Conversation.php:845 src/Content/Conversation.php:848 +#: src/Content/Conversation.php:851 src/Content/Conversation.php:854 #, php-format msgid "You had been addressed (%s)." msgstr "" -#: src/Content/Conversation.php:856 +#: src/Content/Conversation.php:857 #, php-format msgid "You are following %s." msgstr "" -#: src/Content/Conversation.php:859 +#: src/Content/Conversation.php:860 msgid "Tagged" msgstr "" -#: src/Content/Conversation.php:874 +#: src/Content/Conversation.php:875 msgid "Reshared" msgstr "" -#: src/Content/Conversation.php:874 +#: src/Content/Conversation.php:875 #, php-format msgid "Reshared by %s <%s>" msgstr "" -#: src/Content/Conversation.php:877 +#: src/Content/Conversation.php:878 #, php-format msgid "%s is participating in this thread." msgstr "" -#: src/Content/Conversation.php:880 +#: src/Content/Conversation.php:881 msgid "Stored" msgstr "" -#: src/Content/Conversation.php:883 +#: src/Content/Conversation.php:884 msgid "Global" msgstr "" -#: src/Content/Conversation.php:886 +#: src/Content/Conversation.php:887 msgid "Relayed" msgstr "" -#: src/Content/Conversation.php:886 +#: src/Content/Conversation.php:887 #, php-format msgid "Relayed by %s <%s>" msgstr "" -#: src/Content/Conversation.php:889 +#: src/Content/Conversation.php:890 msgid "Fetched" msgstr "" -#: src/Content/Conversation.php:889 +#: src/Content/Conversation.php:890 #, php-format msgid "Fetched because of %s <%s>" msgstr "" @@ -3625,63 +3625,63 @@ msgstr "" msgid "Forum" msgstr "" -#: src/Model/Contact.php:2517 +#: src/Model/Contact.php:2550 msgid "Disallowed profile URL." msgstr "" -#: src/Model/Contact.php:2522 src/Module/Friendica.php:81 +#: src/Model/Contact.php:2555 src/Module/Friendica.php:81 msgid "Blocked domain" msgstr "" -#: src/Model/Contact.php:2527 +#: src/Model/Contact.php:2560 msgid "Connect URL missing." msgstr "" -#: src/Model/Contact.php:2536 +#: src/Model/Contact.php:2569 msgid "" "The contact could not be added. Please check the relevant network " "credentials in your Settings -> Social Networks page." msgstr "" -#: src/Model/Contact.php:2578 +#: src/Model/Contact.php:2611 msgid "The profile address specified does not provide adequate information." msgstr "" -#: src/Model/Contact.php:2580 +#: src/Model/Contact.php:2613 msgid "No compatible communication protocols or feeds were discovered." msgstr "" -#: src/Model/Contact.php:2583 +#: src/Model/Contact.php:2616 msgid "An author or name was not found." msgstr "" -#: src/Model/Contact.php:2586 +#: src/Model/Contact.php:2619 msgid "No browser URL could be matched to this address." msgstr "" -#: src/Model/Contact.php:2589 +#: src/Model/Contact.php:2622 msgid "" "Unable to match @-style Identity Address with a known protocol or email " "contact." msgstr "" -#: src/Model/Contact.php:2590 +#: src/Model/Contact.php:2623 msgid "Use mailto: in front of address to force email check." msgstr "" -#: src/Model/Contact.php:2596 +#: src/Model/Contact.php:2629 msgid "" "The profile address specified belongs to a network which has been disabled " "on this site." msgstr "" -#: src/Model/Contact.php:2601 +#: src/Model/Contact.php:2634 msgid "" "Limited profile. This person will be unable to receive direct/personal " "notifications from you." msgstr "" -#: src/Model/Contact.php:2660 +#: src/Model/Contact.php:2693 msgid "Unable to retrieve contact information." msgstr ""