]> git.mxchange.org Git - friendica.git/commitdiff
Fix ignore link showing for anonymous users
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 23 Nov 2018 06:25:38 +0000 (01:25 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 23 Nov 2018 06:25:38 +0000 (01:25 -0500)
src/Object/Post.php

index 8b17a3b85e6177400cbbd21eea7e9757095597bd..e7a9e6b020e2e6d058e58dee26ace8dfd9b03fe0 100644 (file)
@@ -270,34 +270,36 @@ class Post extends BaseObject
                $tagger = '';
 
                if ($this->isToplevel()) {
-                       $thread = Item::selectFirstThreadForUser(local_user(), ['ignored'], ['iid' => $item['id']]);
-                       if (DBA::isResult($thread)) {
-                               $ignore = [
-                                       'do'        => L10n::t("ignore thread"),
-                                       'undo'      => L10n::t("unignore thread"),
-                                       'toggle'    => L10n::t("toggle ignore status"),
-                                       'classdo'   => $thread['ignored'] ? "hidden" : "",
-                                       'classundo' => $thread['ignored'] ? "" : "hidden",
-                                       'ignored'   => L10n::t('ignored'),
-                               ];
-                       }
+                       if(local_user()) {
+                               $thread = Item::selectFirstThreadForUser(local_user(), ['ignored'], ['iid' => $item['id']]);
+                               if (DBA::isResult($thread)) {
+                                       $ignore = [
+                                               'do'        => L10n::t("ignore thread"),
+                                               'undo'      => L10n::t("unignore thread"),
+                                               'toggle'    => L10n::t("toggle ignore status"),
+                                               'classdo'   => $thread['ignored'] ? "hidden" : "",
+                                               'classundo' => $thread['ignored'] ? "" : "hidden",
+                                               'ignored'   => L10n::t('ignored'),
+                                       ];
+                               }
 
-                       if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
-                               $isstarred = (($item['starred']) ? "starred" : "unstarred");
-
-                               $star = [
-                                       'do'        => L10n::t("add star"),
-                                       'undo'      => L10n::t("remove star"),
-                                       'toggle'    => L10n::t("toggle star status"),
-                                       'classdo'   => $item['starred'] ? "hidden" : "",
-                                       'classundo' => $item['starred'] ? "" : "hidden",
-                                       'starred'   => L10n::t('starred'),
-                               ];
-
-                               $tagger = [
-                                       'add'   => L10n::t("add tag"),
-                                       'class' => "",
-                               ];
+                               if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
+                                       $isstarred = (($item['starred']) ? "starred" : "unstarred");
+
+                                       $star = [
+                                               'do'        => L10n::t("add star"),
+                                               'undo'      => L10n::t("remove star"),
+                                               'toggle'    => L10n::t("toggle star status"),
+                                               'classdo'   => $item['starred'] ? "hidden" : "",
+                                               'classundo' => $item['starred'] ? "" : "hidden",
+                                               'starred'   => L10n::t('starred'),
+                                       ];
+
+                                       $tagger = [
+                                               'add'   => L10n::t("add tag"),
+                                               'class' => "",
+                                       ];
+                               }
                        }
                } else {
                        $indent = 'comment';