]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Post.php
Fix IHTTPResult::getHeader/s()
[friendica.git] / src / Object / Post.php
index a56a73a266410a4b72590e931c4083874b6306bf..628cc95f7a6b856089d8afccd3670f17b785c415 100644 (file)
@@ -236,7 +236,7 @@ class Post
                        ];
                }
 
-               $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? DI::l10n()->t('Save to folder') : false);
+               $filer = local_user() ? DI::l10n()->t('Save to folder') : false;
 
                $profile_name = $item['author-name'];
                if (!empty($item['author-link']) && empty($item['author-name'])) {
@@ -296,7 +296,7 @@ class Post
                $tagger = '';
 
                if ($this->isToplevel()) {
-                       if(local_user()) {
+                       if (local_user()) {
                                $ignored = PostModel\ThreadUser::getIgnored($item['uri-id'], local_user());
                                if ($item['mention'] || $ignored) {
                                        $ignore = [
@@ -309,6 +309,17 @@ class Post
                                        ];
                                }
 
+                               $isstarred = (($item['starred']) ? "starred" : "unstarred");
+
+                               $star = [
+                                       'do'        => DI::l10n()->t('Add star'),
+                                       'undo'      => DI::l10n()->t('Remove star'),
+                                       'toggle'    => DI::l10n()->t('Toggle star status'),
+                                       'classdo'   => $item['starred'] ? "hidden" : "",
+                                       'classundo' => $item['starred'] ? "" : "hidden",
+                                       'starred'   => DI::l10n()->t('Starred'),
+                               ];
+
                                if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
                                        if ($origin) {
                                                $ispinned = ($item['pinned'] ? 'pinned' : 'unpinned');
@@ -323,17 +334,6 @@ class Post
                                                ];
                                        }
 
-                                       $isstarred = (($item['starred']) ? "starred" : "unstarred");
-
-                                       $star = [
-                                               'do'        => DI::l10n()->t('Add star'),
-                                               'undo'      => DI::l10n()->t('Remove star'),
-                                               'toggle'    => DI::l10n()->t('Toggle star status'),
-                                               'classdo'   => $item['starred'] ? "hidden" : "",
-                                               'classundo' => $item['starred'] ? "" : "hidden",
-                                               'starred'   => DI::l10n()->t('Starred'),
-                                       ];
-
                                        $tagger = [
                                                'add'   => DI::l10n()->t('Add tag'),
                                                'class' => "",
@@ -366,7 +366,7 @@ class Post
 
                $body_html = Item::prepareBody($item, true);
 
-               list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item);
+               list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, local_user());
 
                if (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) {
                        $title = ucfirst($item['content-warning']);
@@ -870,7 +870,7 @@ class Post
                        return '';
                }
 
-               $owner = User::getOwnerDataById($a->user['uid']);
+               $owner = User::getOwnerDataById($a->getLoggedInUserId());
 
                if (!Feature::isEnabled(local_user(), 'explicit_mentions')) {
                        return '';
@@ -936,7 +936,7 @@ class Post
                        $uid = $conv->getProfileOwner();
                        $parent_uid = $this->getDataValue('uid');
 
-                       $contact = Contact::getById($a->contact_id);
+                       $contact = Contact::getById($a->getContactId());
 
                        $default_text = $this->getDefaultText();