From 2bbfbd57b021573b1b8eda15c17d9a01afc6cbcf Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 Feb 2021 11:20:02 +0000 Subject: [PATCH] Only offer "ignore thread" when there is a need for this --- src/Object/Post.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Object/Post.php b/src/Object/Post.php index 5996f20d0d..389fac8770 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -300,14 +300,16 @@ class Post if ($this->isToplevel()) { if(local_user()) { $ignored = PostModel\ThreadUser::getIgnored($item['uri-id'], local_user()); - $ignore = [ - 'do' => DI::l10n()->t("ignore thread"), - 'undo' => DI::l10n()->t("unignore thread"), - 'toggle' => DI::l10n()->t("toggle ignore status"), - 'classdo' => $ignored ? "hidden" : "", - 'classundo' => $ignored ? "" : "hidden", - 'ignored' => DI::l10n()->t('ignored'), - ]; + if ($item['mention'] || $ignored) { + $ignore = [ + 'do' => DI::l10n()->t("ignore thread"), + 'undo' => DI::l10n()->t("unignore thread"), + 'toggle' => DI::l10n()->t("toggle ignore status"), + 'classdo' => $ignored ? "hidden" : "", + 'classundo' => $ignored ? "" : "hidden", + 'ignored' => DI::l10n()->t('ignored'), + ]; + } if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) { if ($origin) {