]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Post.php
Merge pull request #11669 from MrPetovan/bug/11666-email-subject-double-encode
[friendica.git] / src / Object / Post.php
index d84404634ac9d9c88b4e9be54575684d84395e87..4c5aa8a21b27b60749de8b42a21503d68e4cb85a 100644 (file)
@@ -32,6 +32,7 @@ use Friendica\Core\Session;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Item;
+use Friendica\Model\Photo;
 use Friendica\Model\Post as PostModel;
 use Friendica\Model\Tag;
 use Friendica\Model\User;
@@ -123,8 +124,8 @@ class Post
        /**
         * Fetch the privacy of the post
         *
-        * @param array $item 
-        * @return string 
+        * @param array $item
+        * @return string
         */
        private function fetchPrivacy(array $item):string
        {
@@ -341,7 +342,7 @@ class Post
                                ];
 
                                if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
-                                       if ($origin) {
+                                       if ($origin && in_array($item['private'], [Item::PUBLIC, Item::UNLISTED])) {
                                                $ispinned = ($item['featured'] ? 'pinned' : 'unpinned');
 
                                                $pin = [
@@ -481,7 +482,7 @@ class Post
                        'profile_url'     => $profile_link,
                        'name'            => $profile_name,
                        'item_photo_menu_html' => DI::contentItem()->photoMenu($item, $formSecurityToken),
-                       'thumb'           => DI::baseUrl()->remove(Contact::getAvatarUrlForUrl($item['author-link'], $item['uid'], Proxy::SIZE_THUMB)),
+                       'thumb'           => DI::baseUrl()->remove(DI::contentItem()->getAuthorAvatar($item)),
                        'osparkle'        => $osparkle,
                        'sparkle'         => $sparkle,
                        'title'           => $title,
@@ -498,7 +499,7 @@ class Post
                        'shiny'           => $shiny,
                        'owner_self'      => $item['author-link'] == Session::get('my_url'),
                        'owner_url'       => $this->getOwnerUrl(),
-                       'owner_photo'     => DI::baseUrl()->remove(Contact::getAvatarUrlForUrl($item['owner-link'], $item['uid'], Proxy::SIZE_THUMB)),
+                       'owner_photo'     => DI::baseUrl()->remove(DI::contentItem()->getOwnerAvatar($item)),
                        'owner_name'      => $this->getOwnerName(),
                        'plink'           => Item::getPlink($item),
                        'browsershare'    => $browsershare,
@@ -528,8 +529,8 @@ class Post
                        'thread_level'    => $thread_level,
                        'edited'          => $edited,
                        'network'         => $item["network"],
-                       'network_name'    => ContactSelector::networkToName($item['author-network'], $item['author-link'], $item['network']),
-                       'network_icon'    => ContactSelector::networkToIcon($item['network'], $item['author-link']),
+                       'network_name'    => ContactSelector::networkToName($item['author-network'], $item['author-link'], $item['network'], $item['author-gsid']),
+                       'network_icon'    => ContactSelector::networkToIcon($item['network'], $item['author-link'], $item['author-gsid']),
                        'received'        => $item['received'],
                        'commented'       => $item['commented'],
                        'created_date'    => $item['created'],
@@ -1007,7 +1008,7 @@ class Post
        /**
         * @return string
         */
-       private function getRedirectUrl()
+       private function getRedirectUrl(): string
        {
                return $this->redirect_url;
        }