diff --git a/include/conversation.php b/include/conversation.php index c2226fa35..a0d1177c3 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -562,9 +562,10 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o ]; $likebuttons = [ - 'like' => null, - 'dislike' => null, - 'share' => null, + 'like' => null, + 'dislike' => null, + 'share' => null, + 'announce' => null, ]; if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) { diff --git a/src/Object/Post.php b/src/Object/Post.php index 894b75f93..f3a4aeba1 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -151,9 +151,10 @@ class Post } $sparkle = ''; $buttons = [ - 'like' => null, - 'dislike' => null, - 'share' => null, + 'like' => null, + 'dislike' => null, + 'share' => null, + 'announce' => null, ]; $dropping = false; $pinned = ''; @@ -175,6 +176,7 @@ class Post : false); $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE; + $announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN]); $edpost = false; @@ -344,7 +346,10 @@ class Post $buttons['like'] = [DI::l10n()->t("I like this \x28toggle\x29") , DI::l10n()->t("like")]; $buttons['dislike'] = [DI::l10n()->t("I don't like this \x28toggle\x29"), DI::l10n()->t("dislike")]; if ($shareable) { - $buttons['share'] = [DI::l10n()->t('Share this'), DI::l10n()->t('share')]; + $buttons['share'] = [DI::l10n()->t('Share this'), DI::l10n()->t('Share')]; + } + if ($announceable) { + $buttons['announce'] = [DI::l10n()->t('Announce this'), DI::l10n()->t('Announce')]; } } diff --git a/view/templates/wall_thread.tpl b/view/templates/wall_thread.tpl index b869b996d..1d1a766c9 100644 --- a/view/templates/wall_thread.tpl +++ b/view/templates/wall_thread.tpl @@ -82,7 +82,8 @@
{{/if}} diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index 0375dc472..2e7a1fb27 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -311,11 +311,17 @@ as the value of $top_child_total (this is done at the end of this file) {{* Button for sharing the item *}} {{if $item.vote}} - {{if $item.vote.share}} + {{if $item.vote.share OR $item.vote.announce}} {{if $item.vote.like OR $item.vote.dislike OR $item.comment_html}} {{/if}} - + {{/if}} + {{if $item.vote.announce}} + + + {{/if}} + {{if $item.vote.share}} + {{/if}} {{/if}} @@ -434,10 +440,18 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} + {{* Button for announcing the item *}} + {{if $item.vote.announce}} + + {{/if}} + {{* Button for sharing the item *}} {{if $item.vote.share}}