From 18b32b68aa36d69b23f3db98b0ade23a8d0a9139 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 9 Jan 2022 12:17:34 -0500 Subject: [PATCH] [frio] Add connector-based privacy display --- src/Model/Item.php | 2 +- src/Object/Post.php | 3 +++ view/theme/frio/templates/search_item.tpl | 3 ++- view/theme/frio/templates/wall_thread.tpl | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index f923fe2691..39d045d0cd 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -80,7 +80,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', 'mention', + 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention', 'global', '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/src/Object/Post.php b/src/Object/Post.php index 827f1dc238..4c6de164a0 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -177,6 +177,8 @@ class Post ? DI::l10n()->t('Private Message') : false); + $connector = !$item['global'] ? DI::l10n()->t('Connector Message') : false; + $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE; $announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]); @@ -469,6 +471,7 @@ class Post 'app' => $item['app'], 'created' => $ago, 'lock' => $lock, + 'connector' => $connector, 'location_html' => $location_html, 'indent' => $indent, 'shiny' => $shiny, diff --git a/view/theme/frio/templates/search_item.tpl b/view/theme/frio/templates/search_item.tpl index c6f19eb168..9b1d2e7397 100644 --- a/view/theme/frio/templates/search_item.tpl +++ b/view/theme/frio/templates/search_item.tpl @@ -63,8 +63,9 @@   + {{elseif $item.connector}} + {{/if}} -
diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index d6790b3e84..3cce85cdef 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -63,7 +63,8 @@ as the value of $top_child_total (this is done at the end of this file) {{if $item.star}} {{$item.star.starred}} {{/if}} - {{if $item.lock}}{{/if}} + {{if $item.lock}} + {{elseif $item.connector}}{{/if}}
{{* /TODO => Unknown block *}} @@ -161,6 +162,8 @@ as the value of $top_child_total (this is done at the end of this file)   + {{elseif $item.connector}} + {{/if}}