]> git.mxchange.org Git - friendica.git/commitdiff
Improve the name of the "followers" receiver
authorMichael <heluecht@pirati.ca>
Wed, 23 Feb 2022 20:18:37 +0000 (20:18 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 23 Feb 2022 20:18:37 +0000 (20:18 +0000)
src/Module/PermissionTooltip.php
src/Protocol/ActivityPub/Receiver.php
view/lang/C/messages.po

index f6722c984a755ea6508b9935d8a7ae62158df0e0..372c508d6f6f217465513918d00c0188597073b0 100644 (file)
@@ -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 = '';
index e82745b7556731fa4341e43319cb67a29104f02b..32994a9d5df51480a3458f8ef88738d5032f16ac 100644 (file)
@@ -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]));
                        }
                }
index 93b3f3731e6c0ce4f3c204fa8eff2d4e825b4443..ea72ffd87e276f192183f1cd1ae8dad55f097bb4 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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 "<b>To:</b> %s<br>"
 msgstr ""
 
-#: src/Module/PermissionTooltip.php:181
+#: src/Module/PermissionTooltip.php:191
 #, php-format
 msgid "<b>CC:</b> %s<br>"
 msgstr ""