From a0fddca407f3594758bd09209aaf9e2075794137 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 2 Apr 2019 05:38:42 +0000 Subject: [PATCH] Display if an item is reshared --- include/conversation.php | 18 ++++++++++++++++-- src/Object/Post.php | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index f7e08571c0..60646e1a01 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -565,8 +565,12 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ $items = $cb['items']; $conv_responses = [ - 'like' => ['title' => L10n::t('Likes','title')], 'dislike' => ['title' => L10n::t('Dislikes','title')], - 'attendyes' => ['title' => L10n::t('Attending','title')], 'attendno' => ['title' => L10n::t('Not attending','title')], 'attendmaybe' => ['title' => L10n::t('Might attend','title')] + 'like' => ['title' => L10n::t('Likes','title')], + 'dislike' => ['title' => L10n::t('Dislikes','title')], + 'attendyes' => ['title' => L10n::t('Attending','title')], + 'attendno' => ['title' => L10n::t('Not attending','title')], + 'attendmaybe' => ['title' => L10n::t('Might attend','title')], + 'announce' => ['title' => L10n::t('Reshares','title')] ]; // array with html for each thread (parent+comments) @@ -963,6 +967,9 @@ function builtin_activity_puller($item, &$conv_responses) { case 'attendmaybe': $verb = ACTIVITY_ATTENDMAYBE; break; + case 'announce': + $verb = ACTIVITY2_ANNOUNCE; + break; default: return; } @@ -1045,6 +1052,9 @@ function format_like($cnt, array $arr, $type, $id) { case 'attendmaybe' : $phrase = L10n::t('%s attends maybe.', $likers); break; + case 'announce' : + $phrase = L10n::t('%s reshared this.', $likers); + break; } } @@ -1084,6 +1094,10 @@ function format_like($cnt, array $arr, $type, $id) { $phrase = L10n::t('%2$d people attend maybe', $spanatts, $cnt); $explikers = L10n::t('%s attend maybe.', $likers); break; + case 'announce': + $phrase = L10n::t('%2$d people reshared this', $spanatts, $cnt); + $explikers = L10n::t('%s reshared this.', $likers); + break; } $expanded .= "\t" . ''; diff --git a/src/Object/Post.php b/src/Object/Post.php index 2890c87ecd..a8577dd8be 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -238,7 +238,7 @@ class Post extends BaseObject $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate)); // process action responses - e.g. like/dislike/attend/agree/whatever - $response_verbs = ['like', 'dislike']; + $response_verbs = ['like', 'dislike', 'announce']; $isevent = false; $attend = []; -- 2.39.5