From 530cfba71e596e22c9b84f296f1ffe4cbec3e566 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 Feb 2021 07:47:07 +0000 Subject: [PATCH 1/3] Offer "follow thread" only when you don't already follow --- include/conversation.php | 2 +- src/Model/Item.php | 2 +- view/theme/frio/theme.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index b74b1f152b..cef0bc0e80 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -899,7 +899,7 @@ function item_photo_menu($item) { $block_link = ''; $ignore_link = ''; - if (local_user() && local_user() == $item['uid'] && $item['gravity'] == GRAVITY_PARENT && !$item['self']) { + if (local_user() && local_user() == $item['uid'] && $item['gravity'] == GRAVITY_PARENT && !$item['self'] && !$item['mention']) { $sub_link = 'javascript:doFollowThread(' . $item['id'] . '); return false;'; } diff --git a/src/Model/Item.php b/src/Model/Item.php index 8c7515e112..48652a0e12 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -76,7 +76,7 @@ class Item 'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink', 'wall', 'private', 'starred', 'origin', 'parent-origin', 'title', 'body', 'language', 'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object', - 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', + 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention', 'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network', 'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'owner-network', 'owner-contact-type', 'causer-id', 'causer-link', 'causer-name', 'causer-avatar', 'causer-contact-type', 'causer-network', diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index 38efc70078..de7c14f84a 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -314,7 +314,7 @@ function frio_display_item(App $a, &$arr) local_user() && local_user() == $arr['item']['uid'] && $arr['item']['gravity'] == GRAVITY_PARENT - && !$arr['item']['self']) + && !$arr['item']['self'] && !$arr['item']['mention']) { $followThread = [ 'menu' => 'follow_thread', From 2bbfbd57b021573b1b8eda15c17d9a01afc6cbcf Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 Feb 2021 11:20:02 +0000 Subject: [PATCH 2/3] 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) { From 2f590b2e07834a5e055cd1a2403184e7fcd86e45 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 28 Feb 2021 07:44:36 -0500 Subject: [PATCH 3/3] Fix condition formatting in view/theme/frio/theme.php --- view/theme/frio/theme.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index de7c14f84a..cbc3b0f04c 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -314,8 +314,9 @@ function frio_display_item(App $a, &$arr) local_user() && local_user() == $arr['item']['uid'] && $arr['item']['gravity'] == GRAVITY_PARENT - && !$arr['item']['self'] && !$arr['item']['mention']) - { + && !$arr['item']['self'] + && !$arr['item']['mention'] + ) { $followThread = [ 'menu' => 'follow_thread', 'title' => DI::l10n()->t('Follow Thread'),